A blockchain oracle is a service that delivers information from outside a blockchain, most often an asset price, in a form smart contracts can read. A lending app on Ethereum has no way to see what ether trades for on exchanges; the number has to be written on chain, and an oracle is whatever does the writing, whether a network of independent operators, a single company or a contract that reads prices from an exchange pool. Whoever controls that number controls what the contract does next. The crypto hub covers the wider market, and what is DeFi shows the lending and trading apps that consume most oracle data.
Why can't a smart contract look up a price itself?
Because every node re-runs every transaction and must reach an identical result, while a website could answer each node differently, change between calls or go offline.
Blockchains get their reliability from that determinism; Ethereum's developer documentation notes that nodes reach agreement using only data already stored on the chain. An oracle closes the gap by posting the outside answer as an ordinary transaction; from then on every node sees the same stored value. Prices are the main product, but oracle networks also publish interest rates, the reserves behind tokens and the results of real-world events such as elections. The contracts on the receiving end are explained in what is Ethereum, and proof of reserves covers one of the non-price uses.
How does a blockchain oracle get a price on chain?
Most designs gather quotes from several sources off chain, combine them and write the result to a contract on a timer, after a price move or on demand.
| Design | How the price arrives | Main weakness | Example |
|---|---|---|---|
| Push network | Independent operators fetch prices; their reports are combined and written on chain when the price moves past a threshold or a timer runs out | The stored price trails the market between updates | Chainlink Data Feeds |
| Pull oracle | Prices are aggregated and signed off the target chain, and an app submits the latest one in the same transaction that uses it | Someone must fetch and pay for each update, or the on-chain price goes stale | Pyth, which aggregates its publishers' prices every 400 milliseconds |
| Exchange average | A contract reads a time-weighted average price (TWAP) from a decentralized exchange pool | A pool with little liquidity can be pushed with modest capital | Uniswap's built-in oracle |
| Optimistic oracle | Anyone proposes an answer with a bond; it stands unless disputed within a challenge period, and disputes go to a vote of token stakers | A disputed answer waits at least two days for the vote | UMA |
| Delayed feed | A new price takes effect only after a fixed delay | The system always acts on a price an hour old | Sky's Oracle Security Module |
Scale differs enormously. On November 2, 2026, DefiLlama counted about $34.0 billion of deposits in 540 protocols relying on Chainlink, against $91 million in 90 protocols pricing assets from exchange-pool averages. That measure, total value secured, is explained under total value locked.
Chainlink's documentation says each feed is updated by multiple independent operators, and that a new round starts on whichever comes first: a deviation threshold, meaning the off-chain price has moved more than a set percentage from the stored one, or a heartbeat, a maximum time since the last update. On Ethereum, the ETH/USD and BTC/USD feeds use 0.5% or one hour, and the USDC/USD and USDT/USD feeds use 0.25% or 24 hours.
Worked example: Chainlink's ETH/USD feed on November 2, 2026
- Latest stored price: $2,290.73 at 05:52:35 UTC, the figure any contract reading the feed would receive.
- Next trigger: an off-chain price below about $2,279.28 or above $2,302.18, which is 0.5% either way, or 06:52:35 UTC, whichever comes first.
- The previous 24 hours: 27 prices written. Of the 26 gaps between them, 21 lasted about an hour, the heartbeat, and 5 were cut short, at 11 to 54 minutes, after moves of 0.5% to 0.6%.
- The takeaway: between updates, a contract acts on a price that can trail exchanges by up to about 0.5%.
The market itself moves continuously, as the live ether price page shows; the feed only samples it.
Why do lending apps and stablecoins depend on oracles?
Because the oracle price decides how much can be borrowed against collateral, when a loan is liquidated and whether a crypto-backed stablecoin is still fully backed.
A lending protocol values each deposit at the oracle price and liquidates loans whose collateral falls below a set ratio; the DeFi guide works through that arithmetic step by step. A price that reads too high lets borrowers take out more than their collateral is worth, leaving the protocol with bad debt, and one that reads too low liquidates loans that were sound.
Crypto-backed stablecoins carry the same exposure. Sky, the protocol formerly called MakerDAO that issues USDS and DAI, values vault collateral such as ETH through its Oracle Security Module, which holds each new price for one hour before the system uses it. Sky says the delay lets vault owners add collateral or repay debt before a lower price takes effect, and lets its price provider, Chronicle, freeze a malicious value before it goes live. Coins backed by cash and Treasury bills rely on a different kind of evidence, reports on their reserves, as how stablecoins work explains. If one of those coins slips below a dollar, a stablecoin depeg, a market-price feed reports the drop to every lending app that reads it, and loans backed by the coin can be liquidated.
How does an oracle manipulation attack work?
The attacker usually leaves the oracle alone and moves the market it reads, then borrows against the inflated price before arbitrage drags it back.
Exchange-pool oracles defend themselves by averaging over time, so a brief spike counts only in proportion to how long it lasted:
Worked example: Why the averaging window decides the damage
- Setup: a token trades at $10, and an attacker lifts it to $50 for one 12-second Ethereum block before arbitrage pulls it back.
- 30-minute window: (10 × 1,788 + 50 × 12) ÷ 1,800 = $10.27, only 2.7% above the real price.
- 15-second window: (10 × 3 + 50 × 12) ÷ 15 = $42, more than four times the real price.
- The prices are illustrative; the two window lengths are the ones in the Inverse Finance case below.
A window that short is what went wrong on April 2, 2022. Inverse Finance's Anchor lending market, since renamed Frontier, priced its INV token with a Keep3r TWAP oracle that read the INV/WETH pool on SushiSwap. According to CertiK's analysis, the pool held about 432 INV and 46 ETH; the attacker spent 300 ETH buying 374 INV, lifting the pool's INV price more than 50-fold, and a flaw in the oracle's sampling meant its intended 30-minute average covered only 15 seconds. Posting INV as collateral at the inflated price, the attacker borrowed 1,588 ETH, 94 WBTC, 39 YFI and about 4 million DOLA, worth $15.6 million in total, according to Inverse Finance. Its post-mortem says no flash loan was involved; the attacker began by withdrawing 901 ETH from the Tornado Cash mixer.
Defenses follow from the same arithmetic: longer averaging windows, prices drawn from many venues rather than one pool, delays such as Sky's hour, tight borrowing limits on thinly traded collateral, and checks on the uncertainty band Pyth publishes with every price, which Pyth says contracts can use to operate more safely. The DeFi guide's table of exploits adds the Mango Markets case from October 2022.
How is an oracle different from a bridge, an API or proof of reserves?
An oracle reports facts to a chain; the others move assets between chains, serve data to ordinary software or prove holdings, and some of them use oracles.
| Term | What it does | How it relates to an oracle |
|---|---|---|
| API | Serves data to ordinary software off chain | Oracle operators often read APIs, but a contract cannot call one |
| Cross-chain bridge | Moves tokens or messages between blockchains | Needs its own operators to vouch for events on another chain, a similar trust problem |
| Proof of reserves | Shows that a custodian or token issuer holds the assets it claims | Results can be published on chain through an oracle feed |
| Price feed | One stream of prices, such as ETH/USD | A single product an oracle network runs |
| Smart contract | Code on the chain that acts on data | The consumer of oracle data, and the party harmed when it is wrong |
The code on the receiving end of every feed is covered under smart contract.
