The problem: blockchains are blind
A blockchain is a closed system. Every node runs the same code on the same inputs and arrives at the same output — that's the entire point, and it's why the system can be trusted without trusting any single participant. But that determinism comes with a hard constraint: a smart contract cannot reach outside its own chain to check anything. It can't fetch a web page, can't query an API, can't ask "what's the price of ETH right now." If it could, different nodes might get different answers at different times, and the whole consensus model falls apart.
This is a real problem, not a theoretical one. A huge share of useful smart contracts need outside information to function. A lending protocol needs to know the current market price of a borrower's collateral to decide whether a position is healthy or should be liquidated. An insurance contract needs to know whether a flight was delayed. A prediction market needs to know who won an election. None of that data originates on-chain, and the chain has no native way to go get it.
So something has to bring the data in from outside and hand it to the contract in a form the contract can read. That something is an oracle.
What an oracle actually is, mechanically
Strip away the branding and an oracle is simple: it's a service that reads data from the outside world and submits it to the blockchain as a transaction. Once that transaction is confirmed, the data sits in a smart contract's storage like any other on-chain value, and other contracts can read it.
The service doing the fetching can be almost anything. It might be a single server run by one company, checking a price feed every few seconds and pushing an update. It might be a decentralized network of dozens of independent operators, each fetching data separately, with their reports combined into one final value before it goes on-chain. Both are "oracles" in the functional sense — a bridge between off-chain fact and on-chain state. The difference between them turns out to matter enormously, but structurally they're doing the same job.
From the smart contract's point of view, there's no way to tell the difference between "real" data and "wrong" data. The contract just reads whatever value is sitting in the oracle's storage slot and acts on it. If the oracle says ETH is worth $3,000, the lending contract treats $3,000 as ground truth, regardless of what price is actually trading on any exchange at that moment.
The trust problem this creates
This is the part that doesn't get emphasized enough: the moment a smart contract depends on an oracle, the contract's security is no longer just a function of its own code. It's a function of its own code and the reliability of every data source it reads from. You can audit the contract logic line by line, prove it handles every edge case correctly, and it still fails if the number it's fed is wrong.
Worse, this dependency doesn't stay contained. If ten different lending protocols all read price data from the same oracle, and that oracle can be manipulated or goes offline, all ten protocols inherit the failure simultaneously. The oracle becomes a shared point of fragility sitting underneath a stack of contracts that otherwise have nothing to do with each other. A well-designed, well-audited contract built on top of a weak oracle is still a weak contract — the strength of the parts you can see doesn't compensate for the weakness of the part you can't.
How manipulation actually works
The classic attack targets price oracles that source data from a single, thin market. Suppose an oracle determines "the price of Token X" by looking at the exchange rate in one particular liquidity pool. If that pool is small — a few hundred thousand dollars of depth, say — it doesn't take much capital to move the price inside it substantially. A large enough trade against that pool can push the reported price 30%, 50%, sometimes far more, for as long as the attacker is willing to hold the distorted position.
Here's where it becomes dangerous rather than just theoretically possible: many attacks bundle the price manipulation and the exploitation into a single transaction, using borrowed funds that are taken out and repaid within that same transaction. The sequence looks roughly like this:
- Borrow a large sum with no upfront collateral, repayable by the end of the transaction.
- Trade heavily against the thin pool the oracle reads from, pushing the reported price far from its real market value.
- Interact with a lending or derivatives contract that trusts the oracle's now-distorted price — borrowing against inflated collateral, or triggering liquidations that shouldn't happen, or minting more of an asset than the manipulated price should allow.
- Unwind the trade, repay the loan, and keep the difference.
The entire sequence executes atomically. If any step fails, the whole transaction reverts and no money moves — which means the attacker risks almost nothing beyond gas costs to attempt it. The economics are lopsided: a failed attempt costs pennies, a successful one can drain a protocol's reserves in seconds.