What is a blockchain oracle?
- Author
- CRYPTO PORT Editorial
- Published
- Updated
- Reading time
- 5 min
In short
An oracle is the machinery that brings off-chain information to a smart contract. Liquidation checks and synthetic asset prices in DeFi all depend on it. If an oracle reports a wrong value, the contract executes faithfully on that wrong value — and assets are lost.
Key points
- It delivers off-chain information to on-chain contracts
- Liquidation checks and collateral valuation rest on it
- A wrong value is executed on just as faithfully
- Designs relying on one source are the ones that get attacked
Definition
A system that fetches data from outside a blockchain and writes it on-chain in a form smart contracts can read — prices most often, but also exchange rates, weather and other external facts.
A smart contract can read only what is on its own chain. What ETH costs right now is a fact about exchanges, which live outside it. An oracle fetches that price and writes it on-chain, and lending liquidations, collateral valuation and derivative settlement all run off the written value. It is a foundation layer for DeFi.
The central design problem is trusting that value. Letting one party write it is simple and fails completely the moment that party errs or is compromised. So the common approach has many independent nodes report and takes something like the median, often requiring reporters to post collateral that is slashed for false submissions.
Real attacks rarely break the oracle itself; they distort the market the price is drawn from. A protocol reading a thin DEX pool directly can be hit with a flash loan that briefly inflates the price, letting the attacker borrow against wildly overvalued collateral and walk away. Using a time-weighted average across several venues is one of the standard defences.
Watch out for
- · When the source is one DEX or a thin book, manipulation can force unjust liquidations or fund bad loans
- · If congestion or an outage stalls updates, contracts keep executing on a stale price
- · A failure or compromise at the oracle operator or its reporting nodes affects every protocol that depends on it