Oracle
- Category
- Blockchain
- Level
- Professional
Simple definition
A service that brings outside information, such as a price, onto a chain so that a smart contract can use it.
Professional definition
A mechanism delivering off-chain data to on-chain consumers. A chain cannot query the outside world, so some reporter must publish the data and some rule must decide whether to accept it — typically aggregation across independent reporters with stake or reputation at risk.
Technical definition
The oracle problem: a contract's correctness becomes conditional on an input it cannot itself verify. Designs manage rather than remove this, using median aggregation over independent reporters, deviation and heartbeat update thresholds, signed attestations and bonded reporters. Update rules matter as much as sources — a feed that refreshes only after a one-percent move is stale by construction between updates, and a contract reading a thin spot market instead of an aggregated feed invites targeted price manipulation.
Academic definition
An agent or protocol attesting to off-chain state for on-chain consumption, thereby introducing a trust and liveness dependency outside the ledger's own validation.
Mechanism
Consensus can agree on what was written, never on whether it was true. An oracle therefore converts an external fact into an on-chain claim, and the contract inherits whatever the reporting process was worth. Aggregation helps because corrupting a median requires corrupting many independent reporters at once rather than one.
In practice
- Who uses it
- DeFi protocol designers, liquidation-engine operators, risk teams sizing collateral rules, and auditors reviewing feed configuration.
- Why it matters
- Lending, derivatives and liquidations are all priced off external data, so the feed is as load-bearing as the contract logic above it.
- Limitations
- The contract cannot check what it is given. A thin spot source can be pushed with borrowed capital, a stale feed liquidates the wrong positions, and a halted feed can freeze a protocol outright.
Common mistakes
- Using one venue's spot price as a contract's price source.
- Ignoring heartbeat and deviation settings when modelling liquidations.
- Assuming decentralised reporting removes manipulation risk.
Examples
Five independent reporters submit 1000, 1002, 1005, 1008 and 1200 units. The median is 1005, so the single outlier moves the accepted value not at all — the reason aggregation uses a median rather than an average.
- reports: 1000, 1002, 1005, 1008, 1200 (unitless, illustrative)
- aggregation rule: median of five
- sort the reports
- take the third value
Illustrative values with no currency attached. The median resists a minority of corrupted reporters; it does not resist a majority of them.
A lending market updates its feed on a deviation threshold. Between updates the on-chain value lags the market, so a fast move can leave positions liquidatable on paper that the feed has not yet recognised.
Related terminology
- related
- Oracle Manipulation Smart Contract Decentralised Finance Liquidation Index Price Mark Price Lending Protocol Flash Loan
Oracle Manipulation
The oracle is the data path. Oracle manipulation is the attack against it, usually by pushing a thin source the contract reads. A robust oracle design is the defence; the oracle itself is not the attack.
Sources
Ethereum Foundation Developer Docs · the oracle problem, aggregation and update mechanisms for on-chain data
https://ethereum.org/developers/docs/oracles/ URL verified
IOSCO · policy discussion of data dependencies and manipulation risk in decentralised finance
https://www.iosco.org/library/pubdocs/pdf/ioscopd754.pdf URL verified
Editorial status
Written, not yet reviewed.
