What Is a Blockchain Oracle?
A blockchain oracle is a system that brings off-chain data, such as asset prices, sports results or weather, onto a blockchain so smart contracts can use it. Most DeFi protocols depend on oracles for prices.
On this page 6
A blockchain oracle is a system that brings off-chain data onto a blockchain in a form smart contracts can use. The dollar price of ETH, the score of a football match or tomorrow’s rainfall does not exist on-chain; it has to be delivered by an oracle. Lending markets, derivatives platforms and many stablecoins cannot function without one.
Why do blockchains need oracles?
Smart contracts can only work with on-chain data, because every node must reach the same result. A contract cannot simply visit a website to check a price: different nodes would see different answers at different moments, and consensus would break. An oracle turns outside information into an on-chain record that everyone reads identically.
This is known as the oracle problem. However secure a blockchain is, a contract that receives bad data will make bad decisions. Who supplies the data, from which sources and how it is aggregated matter as much as the contract code itself.
How does an oracle work?
Take a DeFi lending app. You deposit ETH as collateral and borrow a stablecoin against it. The protocol needs the ETH/USD price to value your collateral, so an oracle network gathers prices from many exchanges, aggregates them and regularly writes the result to an on-chain contract.
If ETH falls below a set threshold, the protocol liquidates your position based on that reported price. A wrong or stale feed can trigger a liquidation at the wrong moment, or fail to trigger one when it should.
Types of oracles, with examples
- Decentralized oracle networks: Many independent node operators supply and sign data. Chainlink is the best-known example, and Pyth Network is widely used for price feeds.
- On-chain oracles: Read prices directly from a DEX pool, often as a time-weighted average.
- Centralized oracles: A single company or institution provides the data. Simple, but a single point of failure.
Oracles carry more than prices. Verifiable randomness, cross-chain messaging and proof-of-reserve checks for tokenized assets are also common oracle services.
What is oracle manipulation?
Oracle manipulation means temporarily distorting the price an oracle reads and profiting from the false value. Protocols that take prices from a single thinly traded market are the most exposed. In October 2022, a trader on Solana-based Mango Markets pumped the price of the MNGO token and used the inflated collateral to borrow more than $100 million from the protocol.
Incidents like this explain why robust oracle designs pull from multiple sources, filter out sudden outliers and use time-weighted averages.
Frequently asked questions
Is an oracle the same as a bridge?
No. An oracle brings outside data on-chain, while a bridge moves assets or messages between blockchains. Some oracle networks also offer bridging.
Why is it called an oracle?
The name is borrowed from the oracles of the ancient world, but these systems don’t predict anything. They simply relay existing information to the chain.