Blockchain Oracles: Where Smart Contracts Get Their Prices
On this page
A blockchain oracle is the piece that answers a simple question no smart contract can answer on its own: what is this worth right now? A lending contract needs the collateral price to decide how much you can borrow and when to liquidate your position, and that price comes from outside the blockchain. The oracle delivers it, and many attacks on decentralised finance protocols start there. This post explains, from Ethereum and provider documentation, incident databases and the official records of a well-known case, read on 25 November 2026, what an oracle is, how it can be manipulated and what that changes for anyone depositing in DeFi.
In short
- Oracles are applications that bring off-chain data to contracts. ethereum.org calls the dependency this creates the "oracle problem".
- Oracle networks use several independent operators and only update a price after a minimum number of responses, per Chainlink's documentation, which also warns about manipulation in low-liquidity assets.
- Per a Chainalysis study of 7 March 2023, DeFi protocols lost US$403.2 million in 41 oracle manipulation attacks in 2022 alone.
- In the Mango Markets case of October 2022, more than US$110 million left a protocol, per the CFTC. A jury convicted the defendant in 2024; the judge vacated and acquitted in 2025, and the government appealed.
- For depositors, the oracle sets the price at which your position is liquidated.
| Term | What it is | Where the risk is |
|---|---|---|
| Oracle | A service that publishes outside data on chain | The contract trusts the data it gets |
| Price feed | An asset price updated in the contract | Wrong or stale data |
| Deviation threshold | Updates when the price moves past a percentage | Fast moves between updates |
| Heartbeat | Maximum time without an update | An old price in a volatile market |
| Spot price from a decentralised exchange | The price of a single pool used as a reference | Easy to move with enough money |
What an oracle is
ethereum.org defines it: "Oracles are applications that produce data feeds that make offchain data sources available to the blockchain for smart contracts." The most common example in decentralised finance is price: a lending protocol needs to know the collateral's value to work out how much you can borrow and at what point the debt crosses the limit.
The problem is trust. A smart contract is meant to work without depending on anyone, but if it uses outside data, it comes to depend on whoever supplies that data. ethereum.org names this "the so-called oracle problem". The same page lists three criteria for assessing an oracle: whether the data is correct, whether it is available when needed and whether whoever supplies it has an incentive not to lie.
How an oracle network works
The most common way to reduce the dependency is not to trust a single operator. The documentation of Chainlink, one of the most widely used providers, says that "Each data feed is updated by multiple, independent Chainlink oracle operators", and that the contract aggregating the answers "must receive responses from a minimum number of oracles or the latest answer will not be updated". The price updates when it moves past a deviation threshold or when a maximum time without an update, the heartbeat, has passed. These services also publish other data, such as proof of reserves, fund unit values and interest rates.
The same documentation notes the method's limit: developers should "make sure that the asset has a sufficiently healthy level of liquidity in the market to avoid price and market manipulation", and "Note that all feeds contain some inherent risk."
Alerts on DeFi and stablecoins
An e-mail when something changes on this topic: new rules, deadlines, scams going around and Vault news.
How an oracle gets manipulated
The most common attack, explained at the level of those who might fall victim, does not break the oracle: it fools the source. If the protocol uses as its reference the price from a single pool on a decentralised exchange, or of a low-liquidity asset, someone with enough money can push that price for a few minutes, and the contract comes to believe the fake price when lending or liquidating. Chainalysis, a blockchain analytics firm, noted that the money to move the price often comes from a flash loan, borrowed and repaid in the same transaction.
Not every attack of this kind is spot price manipulation. There are also cases of a misconfigured oracle and of a stale price, where the contract accepts a value that no longer matches the market.
The numbers
There is no single official count of oracle attacks: each firm that keeps an incident database uses its own criteria to classify a case, and totals change as cases are added or reclassified. The most cited published figure is Chainalysis's:
- Chainalysis, 2022: "DeFi protocols lost $403.2 million in 41 separate oracle manipulation attacks", per a study of 7 March 2023.
In the years that followed, the largest sums stolen in crypto left by another route. Per Chainalysis's report of 19 December 2024, compromised private keys were the largest share of what was stolen in 2024, at 43.8%. Oracle manipulation still happens but, going by the published reports, it is no longer what weighs most in the total.
The Mango Markets case
On 11 October 2022, the Mango Markets protocol lost more than US$110 million, per the CFTC, the US derivatives regulator. Per the charges, the protocol's token price "as reported by the oracle, jumped over 13-fold during a 30-minute span", and with that inflated price as collateral the assets were withdrawn. The CFTC called it "its first involving a scheme that is sometimes called oracle manipulation", and recorded that about US$67 million was returned to the protocol. The court decision describes the oracle as drawing prices from three exchanges to compute the reference value.
The court outcome is what people most often get wrong, so it is worth being exact. A New York jury convicted the defendant on three counts on 18 April 2024. On 23 May 2025, the judge vacated the two commodities counts for improper venue and acquitted on the wire fraud count, for lack of proof of a false representation. The decision itself notes that vacating for venue "plainly does not resolve the bottom-line question of criminal culpability", and it held that there was evidence of intent to manipulate. The government appealed on 22 July 2025; as of 25 November 2026 we found no appeals court decision, and the civil cases of the CFTC and the SEC, the US securities regulator, are stayed until the criminal case ends.
Another case with an official record
In April 2024, a security engineer was sentenced to three years in prison for attacking two decentralised exchanges in July 2022, in what the US Department of Justice called "the first ever conviction for the hack of a smart contract". In one of the attacks, per the release, he "used fake pricing data to generate approximately $9 million worth of inflated fees"; in the other, he took US$3.6 million, almost all of Nirvana Finance's money, which shut down soon after. The Department of Justice does not use the term "oracle manipulation"; DefiLlama classes the Nirvana attack that way.
What this changes for DeFi depositors
For anyone borrowing against crypto collateral, the oracle decides the price at which the position is liquidated: if it receives a wrong price, through manipulation or delay, liquidation can happen without the real market getting there. For anyone depositing to lend, an oracle attack can leave the protocol with debts nobody repays. How to work out a liquidation price is in Aave Health Factor: At What Price Your Loan Gets Liquidated, and how to read a protocol's numbers in How to Read DeFiLlama: TVL, Revenue and Yields Explained.
The same question arises in real-world asset tokenization, where an oracle reports fund unit values, as Real-World Asset Tokenization: Bonds and Funds On-Chain shows.
How to decide without an advisor
Before depositing in a protocol that uses prices, four questions:
- Where does the price come from? From an oracle network with several operators or from a single pool?
- Does the collateral have liquidity? Low-volume assets are the easiest to manipulate.
- Has the protocol been attacked before? DefiLlama's public database records incidents by protocol and type.
- How much of your wealth is exposed? None of the answers above removes the risk; they only help size it.
The general risks of decentralised finance are in What is DeFi: uses, real risks and the rules in Brazil, and the other topics in the series in Crypto Technology Glossary: x402, NFTs, Lightning and More.
Why a CVM-authorized advisor cannot promise returns
CVM Resolution 19/2021 (art. 16, I and II), the rule of Brazil's securities regulator for securities advisors, requires the advisor to act "with good faith, transparency, diligence and loyalty, placing the interests of clients above its own" and to pursue the client's objectives "taking into account their financial situation and profile". Art. 18 forbids the advisor from "guaranteeing levels of return" and from "omitting information on conflicts of interest and risks". That is why the serious answer to "is this protocol safe to deposit in?" goes through how much of your wealth can bear contract and oracle risk, not through an advertised yield. What advisory delivers to someone with meaningful wealth is in Crypto advisory for high-net-worth and family offices, and the service, step by step, in crypto advisory: how it works.
Crypto assets carry high risk, including significant volatility and the possibility of losing the invested capital. This article is educational and is not investment advice. Vault Capital is a securities advisory firm authorized by Brazil's CVM under Resolução CVM nº 19/2021, never takes custody of client assets, and its obligations are detailed on the compliance and regulation page.
What a smart contract is, and the other ways it can fail, is covered in Smart Contracts Explained: What They Are and What Can Fail.
Why oracles often fall outside an audit's scope is covered in Smart Contract Audits: What They Cost and What They Miss.
Frequently asked questions
What is a blockchain oracle?
A service that brings off-chain data, such as an asset price, into smart contracts. Lending, derivatives and tokenized fund contracts depend on that data to work, because they cannot fetch it on their own.
What is the oracle problem?
The dependency a smart contract takes on whoever supplies the outside data. The contract only works correctly if the data is right, and trusting the oracle operator reintroduces the trust the blockchain tried to remove.
What is oracle manipulation?
Artificially moving the price an oracle reads, for example in a low-liquidity pool, so the contract lends or liquidates based on a fake value. Per a Chainalysis study of 7 March 2023, there were 41 such attacks on DeFi protocols in 2022 alone, with US$403.2 million lost.
What happened in the Mango Markets case?
In October 2022, more than US$110 million left the protocol after its token price, as read by the oracle, rose more than 13-fold in 30 minutes, per the CFTC. A jury convicted the defendant in 2024; in 2025 the judge vacated two counts and acquitted on the third, and the government appealed.
How can I tell whether a DeFi protocol uses a safe oracle?
There is no guarantee, but there are signs: prices from several independent operators, collateral with enough liquidity and no incidents in the public hacks database. Chainlink's own documentation says every price feed carries some risk.
Is DeFi regulated in Brazil?
The rules that apply to people using decentralised finance from Brazil, and what still has no rule, are in What is DeFi: uses, real risks and the rules in Brazil, along with contract, oracle and governance risks.
Let's talk
If you use DeFi loans or deposits with meaningful amounts, the question before the yield is where the price that decides your liquidation comes from. Vault's diagnostic is free and carries no commitment. Assets always stay in your name.
Want a strategy for your crypto wealth?
Vault Capital is a CVM-authorized securities advisory. See how the advisory works, what it costs and who it is for.
Learn about the crypto advisoryPath · DeFi and stablecoins
Start the DeFi and stablecoins path
What is DeFi: uses, real risks and the rules in Brazil
What is DeFi: how decentralized finance replaces the intermediary with code, where the money sits, the risks with a named example and what Brazil requires.