TXKN

The leaks · 48 / 86 · 3 min

Oracles

A contract cannot see the outside world by itself. An oracle is the feed that tells it a price. If the feed lies, the contract acts on the lie, and people lose deposits.

The contract believes the feed
A price off-chainAn oracleThe contractLiquidations

If the feed lies, the contract acts on the lie. People lose deposits that the contract thinks are under water.

A worked case

A lending contract trusts a thin market for a price. Someone trades that market for a moment. The feed updates. Borrowers are liquidated against a price that existed for a block. The contract was obedient. The feed was the mistake.

Where the price comes from

A single exchange, a handful of reporters, or a median of many markets. A thin market is easy to push for a moment. That moment can be enough to liquidate borrowers or drain a pool.

The check

Ask which markets the feed uses, and what happens if one of them breaks. A protocol that prices itself from its own tiny pool is marking its own homework.

You do not need to build the lie. You need to see that the price is an input someone can shove.

The contract believed a thin market

A lending contract cannot see the world. It asks an oracle what a price is, and then it liquidates people based on the answer. Chainlink and similar networks exist because a single exchange's price is easy to shove. They are still a set of signers and a set of choices about which markets count. If the markets underneath are thin, the median of liars is still a lie.

Mango Markets, in October 2022, is the case people use for a price that was the attack. The US Commodity Futures Trading Commission later charged a trader with taking more than 110 million dollars by moving a price the protocol trusted, then withdrawing against that price. This page will not describe the trades. The shape is enough: the contract did what it was told by a number one person could move.

Before you lend to a protocol or borrow from one, ask which market is allowed to tell it the price, and what happens if that market is empty for a block. The liquidation will not wait for a better print.

Read it yourself

These links are the record. They are not a recommendation, and they are not instructions. A news story or a court paper can still be wrong about a detail. The check does not change because a famous name is in the story.

Apply the check

Open a question. The line is about this topic. It is not a verdict that anything is safe.

Check yourself

Is the price inside a contract the same as a deep global market?

Only if the oracle actually reads a deep market. Sometimes it does not.

After this you can ask where a protocol gets its price, and what a one-minute lie would do.