What is a blockchain oracle?
Every DeFi loan and liquidation depends on a price the blockchain cannot check for itself. The service that supplies it is the oracle.
Logos are trademarks of their respective owners, shown for identification only. Their use does not imply endorsement. Licences.

On this page
- A blockchain oracle is a service that brings off-chain data, such as asset prices, onto a blockchain so smart contracts can use it.
- Smart contracts trust whatever the oracle reports, so a wrong or manipulated price can trigger wrong liquidations or let attackers drain funds.
- Decentralized oracle networks aggregate data from many sources and independent node operators to avoid a single point of failure.
- Prices taken straight from one exchange pool are cheap to manipulate; time-weighted averages raise the cost but add delay.
- The FSB warns that a shock can spread when many protocols rely on a single oracle.
A blockchain oracle is a service that feeds outside information — most often asset prices — into smart contracts, which cannot fetch outside data on their own. DeFi lending and trading apps act on those prices automatically, so a wrong price can directly cost users money.
Why do blockchains need oracles?
A blockchain is a closed system. Every computer on the network must reach the same result when it runs a smart contract. ethereum.org explains that if nodes pulled in outside information themselves, they could get different answers and would no longer agree on the state of the chain. So contracts only read data that is already on-chain. They cannot look up the price of ether, the weather or a football score.
ethereum.org defines oracles as applications that produce data feeds making off-chain data available to smart contracts. It also names the catch, often called the oracle problem: a contract only executes correctly if the oracle's data is correct, yet having to trust an oracle operator undermines the point of a trustless contract. The oracle becomes the part of the system you have to believe.
How does an oracle get data onto a blockchain?
ethereum.org describes two common patterns. In the request-response model, a contract asks for a piece of data, off-chain nodes fetch it and send it back in a later transaction. In the publish-subscribe model, the oracle keeps a feed updated on-chain and any contract can read the latest value. Price feeds for DeFi use the second pattern, because lending and trading apps need a current price at all times.
Chainlink, one such oracle network, says its price feeds are aggregated from many data sources by a decentralized set of independent node operators and published on dozens of blockchains.
Collect. Independent node operators gather prices from several data sources.
Aggregate. The network combines the reports into one value; comparing many sources reduces the risk of passing on a bad number.
Publish. The value is written to an on-chain contract that anyone can read.
Consume. A lending protocol reads the feed to value collateral and decide whether a loan can be liquidated.

What kinds of oracle are there?
The main design choice is how many independent parties stand behind the number. ethereum.org contrasts centralized oracles, run by one entity and a single point of failure, with decentralized ones, where multiple participants must agree and can be penalized for dishonest reports.
| Price source | How it works | Main weakness |
|---|---|---|
| Centralized oracle | One operator posts the price | If that operator fails or is compromised, every dependent contract is affected |
| Decentralized oracle network | Many nodes and sources, aggregated | Still only as good as the underlying markets; thinly traded assets stay vulnerable |
| DEX spot price | Read the current ratio in one exchange pool | Can be pushed around within a single transaction |
| DEX time-weighted average (TWAP) | Average a pool's price over a period | Harder to move, but lags fast real moves |
Uniswap's documentation explains that the cost of manipulating a simple TWAP rises roughly in line with both the pool's liquidity and the length of the averaging window. It also warns that if enough value depends on a manipulable price, an attacker's profit can outweigh that cost.
What happens when an oracle reports the wrong price?
The contract obeys it. If a feed says collateral is worth more than it is, a borrower can take out loans that will never be repaid; if it says collateral is worth less, healthy positions can be liquidated. The Financial Stability Board warns that oracles could start or spread a shock, especially when a dominant protocol depends on one or many protocols share a single oracle.
A well-documented case is Mango Markets. According to the US Commodity Futures Trading Commission, on 11 October 2022 a trader built large leveraged positions on the platform and then bought the MNGO token heavily on the outside exchanges that fed its price oracle. The CFTC alleged that the oracle-reported MNGO price jumped more than 13-fold in about 30 minutes, and that the inflated positions were used as collateral to withdraw over $110 million. These are allegations in a civil complaint. Separately, an FBI warning from 2022 described attackers exploiting a platform's reliance on a single price oracle to take about $35 million.
What mistakes do people make about oracles?
- Assuming the protocol's price is "the" market price. It is whatever the oracle last reported, and it can lag or diverge from what you see on an exchange.
- Ignoring the collateral's market. Chainlink's own developer guidance says assets with low liquidity are the most vulnerable to manipulation. A protocol accepting thinly traded tokens as collateral carries extra risk.
- Treating "uses a decentralized oracle" as a guarantee. Chainlink states that developers remain solely responsible for safeguards such as data-quality checks and circuit breakers.
- Overlooking oracle risk in your own positions. Aave lists oracle risk among the risks of using its protocol; if you borrow, read how DeFi lending works to see how a price feed decides your liquidation.

Questions readers ask
Is Chainlink the only oracle?
No. ethereum.org lists several oracle services, including Chainlink, Witnet and Band Protocol, and many protocols also read prices from decentralized-exchange pools. Mentioning a provider here is not an endorsement.
Can an oracle provide data other than prices?
Yes. ethereum.org gives examples including verifiable random numbers for games, real-world event outcomes for insurance and prediction markets, and triggers for automating contract functions.
Why not just use the price from a decentralized exchange?
Because a single pool's current price can be moved within one transaction, sometimes with borrowed funds (a flash loan). Time-weighted averages make this costlier but react more slowly. See how decentralized exchanges work.
Are oracle attacks the same as hacks?
Not always. Some exploit a code bug; others use the system exactly as designed, feeding it a distorted market price. Regulators may still treat deliberate price manipulation as illegal, as the CFTC's charges in the Mango Markets case show.
Oracles are the eyes of DeFi: without them a lending protocol cannot value collateral or decide when to liquidate. They are also a favorite target, because changing one number can move millions. When you assess any protocol, look at where its prices come from, how many independent parties stand behind them, and how liquid the markets they read really are.
Sources
- ethereum.org developer docs, Oracles (2026)Primary source
- Chainlink documentation, Chainlink Data Feeds (2026)Primary source
- Chainlink documentation, Data Feeds: developer responsibilities (2026)Primary source
- Uniswap documentation, Oracles (Uniswap v2 core concepts) (2020)Primary source
- US Commodity Futures Trading Commission, CFTC Charges Avraham Eisenberg with Manipulative and Deceptive Scheme to Misappropriate Over $110 million from Mango Markets (Release 8647-23) (2023)Primary source
- FBI Internet Crime Complaint Center, Cyber Criminals Increasingly Exploit Vulnerabilities in Decentralized Finance Platforms (PSA I-082922) (2022)Primary source
- Financial Stability Board, The Financial Stability Risks of Decentralised Finance (2023)Primary source
- Aave documentation, Aave FAQs (2025)Primary source
Educational content only — not financial, investment, legal or tax advice. Crypto-assets are high-risk and you could lose all the money you put in. Rules differ by country; check with your national regulator. See our risk disclosure and editorial policy.



