Blockchain Oracle
A blockchain oracle is a service that delivers external data, such as asset prices or event outcomes, to smart contracts, which cannot natively access information from outside their own chain.
A blockchain oracle is a service that delivers external data, such as asset prices or event outcomes, to smart contracts, which cannot natively access information from outside their own chain. Outside crypto, an oracle means an authoritative source consulted for answers; the onchain usage borrows that sense and makes it a data pipeline.
How it works
A smart contract cannot call an external API or read a stock price directly, because every node must reach the same result deterministically. An oracle solves this by having off-chain nodes fetch data, agree on a value, and write it onchain where contracts can read it. Chainlink runs decentralized networks where multiple node operators report a price, and the median is posted to an onchain aggregator contract. Pyth takes a pull model: first-party publishers such as trading firms and exchanges sign price updates, and an application submits the latest signed update onchain when it needs one.
Designs differ in who provides the data and when it updates. A Chainlink feed might update when the price moves past a 0.5 percent deviation threshold or after a set heartbeat interval. Aave reads these feeds to value collateral, so if ETH is reported at 2,000 and a borrower holds 10 ETH, the protocol marks the position at 20,000 and checks it against the loan. Some systems use time-weighted average prices from a Uniswap pool as an onchain-native alternative that needs no external reporters.
Why it matters
Oracles are the trust boundary between onchain logic and the real world, so they are a frequent attack surface. Lending markets, derivatives, and stablecoins all depend on reported prices to trigger liquidations, settle trades, or maintain pegs. A manipulated or stale feed can drain a protocol: the Mango Markets exploit in 2022 moved a thin spot price to inflate collateral and borrow against it. This is why deviation thresholds, multiple independent sources, and circuit breakers matter for an institutional reader assessing counterparty and smart-contract risk.
Related terms
- Price feed
- Time-weighted average price (TWAP)
- Smart contract
- Oracle manipulation
- Decentralized finance (DeFi)
Frequently asked questions
Why can't smart contracts fetch data themselves?
Blockchains require every node to reach identical results. An external API call could return different values to different nodes, breaking consensus, so data must be fetched off-chain and written onchain through an oracle instead.
What is the difference between push and pull oracles?
Push oracles post updates onchain automatically based on price deviation or time intervals, as Chainlink feeds do. Pull oracles, like Pyth, require an application to submit a signed update onchain only when it needs the value.
What is oracle manipulation?
Oracle manipulation is an attack where someone distorts the data source an oracle reports, often a thin market, to feed a protocol a false price and extract value, as seen in the 2022 Mango Markets exploit.
See the data behind this post. Browse the full dataset catalogue, or read What Is Onchain Data Normalization? for how the records are put together.
Allium provides onchain data infrastructure. Companies named in this article may be Allium customers, prospects or commercial counterparties. The authors and other Allium personnel may hold positions in the assets discussed. This article is informational only and is not investment, legal or tax advice. Data and information last reviewed: October 23, 2026.