Glossary
Blockchain oracle
A service that supplies a blockchain with outside data, such as asset prices, which smart contracts cannot fetch for themselves.
On this page
A blockchain can verify only what is recorded on it. A smart contract cannot look up the price of ether in dollars, an interest rate, or the result of an election. An oracle is the mechanism that brings such information on-chain so contracts can act on it.
Why DeFi depends on them
- Lending. A protocol needs the price of the collateral to know when a loan is under-secured and must be liquidated.
- Derivatives need prices to settle.
- Stablecoins backed by crypto need prices to keep enough backing.
If the price a contract receives is wrong, the contract carries out the wrong action, automatically and irreversibly.
How they are built
- Oracle networks. Many independent operators each fetch prices from several exchanges. The reports are combined, typically by taking the median, and published on-chain. Operators may have to post a deposit they lose if they misreport.
- On-chain prices. A contract reads the price from a decentralized exchange pool. This avoids outside parties, but the pool price can be pushed around by a large trade. Averaging the price over time makes that harder.
Oracle manipulation
What to look at
Which oracle a protocol uses, how many sources feed it, how often it updates, and what happens if it stops.
Limits
Oracles bring back a point of trust that blockchains were meant to remove. A decentralized application is only as reliable as the data it is given, and delays in a fast market can cause wrongful liquidations even without an attacker.
