Oracles: how blockchains learn what a price is
A blockchain cannot see outside itself, so every lending market and derivative depends on data pushed in from somewhere. That dependency is behind a long list of nine-figure exploits.
Reviewed by Mason Walker, Ethereum & Layer-2 · Last reviewed October 30, 2026

On this page
An oracle brings external data onto a blockchain. Contracts are deterministic and isolated by design: they can read their own chain's state and nothing else, so they have no way of knowing an asset's price, a match result or an interest rate unless something publishes it on-chain. Lending markets, derivatives, stablecoins and insurance all depend on that published number being right — which makes the oracle the most consequential external dependency in decentralised finance.
Why can't a contract just fetch a price?
Every node must reach the same result when executing a transaction, otherwise consensus fails. If a contract could call an external service, two nodes might receive different answers and disagree about the state of the chain. Determinism is therefore structural, and the only way data enters is as a transaction someone signs and pays for.
How does a price feed work?
- Independent reporters collect prices from multiple exchanges, weighted by volume and liquidity.
- Outliers are trimmed and the remainder aggregated, usually to a median rather than a mean.
- Reporters sign their submissions; a contract accepts the result once enough of them agree.
- Updates are published on a heartbeat or when the price moves beyond a threshold, since every update costs gas.
- Consumers read the latest value along with its timestamp, and should reject data that is too old.
What is an oracle manipulation attack?
If a protocol derives its price from a market that can be moved cheaply, an attacker moves it. The classic sequence: borrow a large amount with a flash loan, push the price of a thinly traded asset far from reality on the venue the oracle reads, use the distorted valuation to borrow against inflated collateral or liquidate someone unfairly, then repay the loan in the same transaction.
Nothing about the oracle was hacked. It reported what the market said, and the market was cheap to lie to. This is why sourcing matters more than the feed's uptime — our guide to crypto liquidity explains why thin markets are so easy to move.
What defences exist?
| Defence | How it helps | Limitation |
|---|---|---|
| Multi-source aggregation | One venue cannot set the price alone | Correlated failures across venues remain |
| Time-weighted average price | Manipulation must be sustained, not instantaneous | Slower to reflect genuine moves |
| Multiple independent reporters | No single operator can publish a false value | Coordination and liveness costs |
| Deviation and staleness checks | Contract rejects implausible or old data | Can halt the protocol during real volatility |
| Circuit breakers | Pause on extreme moves | Requires someone trusted to resume |
What else do oracles provide?
Prices dominate, but the same infrastructure delivers other data: proof of reserves for wrapped assets, randomness for games and lotteries, cross-chain messages, interest rates and event outcomes. Each carries its own version of the same question — who is asserting this, and what happens if they are wrong or absent?
What should you check as a user?
- Which oracle a protocol uses, and whether it is a recognised network or something bespoke.
- Whether the feed aggregates across venues or reads a single pool.
- How the contract handles stale or extreme data — pausing is safer than proceeding.
- Who can change the oracle address, and whether that change is timelocked.
- For thinly traded collateral, whether a reliable feed exists at all.
Oracle design decides whether a lending market survives a violent hour — the mechanics of that are in our guide to DeFi lending and liquidations, and the stablecoin angle in our guide to stablecoins and their risks.
What happens when an oracle stops updating?
Liveness failure is the quieter risk. A feed that stops publishing leaves protocols reading a stale price, which during a fast market is arguably worse than no price: positions that should be liquidated are not, and collateral is valued at yesterday's number.
Well-built protocols handle this by rejecting data older than a threshold and pausing rather than proceeding on stale input. That protects the protocol and freezes the user — borrowing, repaying and withdrawing may all stop until the feed recovers. It is an uncomfortable but correct trade, and it is worth knowing that it is the intended behaviour rather than a malfunction.
- Check whether a protocol you use documents its staleness threshold and pause behaviour.
- Expect functions to be unavailable during a feed outage, including repayments.
- Keep a buffer above liquidation thresholds so a delayed feed does not catch you at the edge.
- Prefer collateral with deep markets and well-supported feeds over exotic assets.
- 1. Oracles — ethereum.org
- 2. Smart contract security considerations — ethereum.org
- 3. Decentralised finance overview — ethereum.org
Frequently asked
What is a blockchain oracle?
A system that publishes external data on-chain so smart contracts can use it. Contracts are deterministic and cannot fetch outside data themselves.
Why do oracles matter for DeFi?
Lending, derivatives and stablecoins all price collateral using an oracle. A wrong or manipulated price causes unfair liquidations or lets someone borrow far more than their collateral is worth.
What is oracle manipulation?
Moving the market an oracle reads — usually a thin pool, often with borrowed capital — so a protocol values an asset incorrectly and can be exploited within the same transaction.
What is a TWAP oracle?
One that reports a time-weighted average price rather than the instantaneous price, so manipulating it requires holding the market away from fair value for a sustained period.
Can an oracle be decentralised?
The reporting can be spread across many independent operators with on-chain aggregation, which removes single points of failure. The underlying data still comes from markets that can themselves be manipulated.

Kayla Peterson is a DeFi Research Analyst at Crypto Almanac Daily, where she specializes in decentralized finance, lending protocols, decentralized exchanges (DEXs), liquidity markets, yield strategies, and tokenomics. Her work focuses on analyzing the mechanics behind DeFi ecosystems, helping readers understand how lending platforms, automated market makers, liquidity incentives, and governance models influence the broader digital asset economy. Kayla regularly covers major protocols, emerging trends in on-chain finance, and the evolution of decentralized financial infrastructure through data-driven research and in-depth market analysis. Before joining Crypto Almanac Daily, she researched blockchain-based financial systems and digital asset markets, building expertise in protocol design, token economics, and decentralized capital markets. Her reporting combines technical accuracy with clear explanations, making complex DeFi concepts accessible to both experienced investors and newcomers to the industry. At Crypto Almanac Daily, Kayla contributes daily market coverage, protocol analyses, educational guides, and long-form research articles. Her goal is to provide readers with reliable, objective insights into the rapidly changing world of decentralized finance while highlighting the opportunities and risks shaping the next generation of financial innovation.
This guide is educational and general in nature. It is not financial, investment, legal or tax advice, and it does not account for your circumstances. Crypto assets are volatile and you can lose the money you put in. See our editorial policy and methodology.


