What it is
Blockchains have no native awareness of off-chain information like asset prices — a smart contract can't ask "what is ETH worth right now" without help. An oracle price feed is the infrastructure that fetches, aggregates, and delivers that outside price data on-chain in a form contracts can read and trust enough to act on, whether to check if a loan is undercollateralized or to price a trade.
How it works
- A set of data sources — typically many centralized and decentralized exchanges — report prices for an asset in real time.
- An oracle network of independent node operators (or, in simpler designs, a single trusted reporter) collects these prices, filters out outliers, and computes an aggregate value, often a median or volume-weighted average.
- This aggregated price is published on-chain, either by regularly "pushing" an update to a smart contract at fixed intervals or thresholds, or by making it available for any contract to "pull" and verify on demand.
- Consuming smart contracts — a lending protocol, a stablecoin, a derivatives platform — read this on-chain price whenever they need it, for example to check if a borrower's collateral ratio has fallen below the liquidation threshold.
- Many designs include safeguards like time-weighted averaging (using a moving average over a window rather than a single instantaneous price), deviation thresholds that trigger updates, and multiple independent node operators whose reports must agree within a tolerance.
- If the oracle stops updating, disagrees internally, or reports a price too far from historical values, some protocols pause dependent functions (like liquidations) until the feed is trusted again.
Why designers use it
- Lets on-chain contracts react to real-world market conditions (collateral value, exchange rates) that don't exist natively on the blockchain.
- Decentralized, multi-source aggregation is much harder to manipulate than relying on a single exchange's price, which reduces the risk that an attacker can cheaply move the price feed.
- Time-weighted or median-based aggregation smooths out short-term spikes and flash-loan-driven price distortions on any single venue.
- Enables an entire category of DeFi products — lending, synthetic assets, derivatives, stablecoins — that fundamentally require accurate external price knowledge to function safely.
Failure modes
- Oracle manipulation via thin markets: an attacker who can temporarily distort the price on a source the oracle reads from (especially a low-liquidity venue or a single DEX pool) can trick dependent contracts into mispricing collateral or triggering unjust liquidations.
- Flash-loan price attacks: borrowing a large amount of capital for a single transaction to briefly swing a price on an under-protected feed, then using that distorted price to drain a lending or liquidation-dependent protocol, has been a repeated real-world exploit pattern.
- Stale or frozen feeds: if an oracle stops updating (due to a bug, network issue, or economic disincentive for reporters) while prices move sharply in the real world, dependent contracts operate on outdated data, either failing to liquidate risky positions in time or liquidating fairly positions incorrectly.
- Centralization or collusion risk: if the "decentralized" oracle network is actually controlled by a small number of operators, they can collude or be compromised to report a false price.
- Update-timing exploits: attackers can time transactions around known oracle update intervals to front-run predictable price changes.
What to check before using it
- Check how many independent data sources and node operators feed into the oracle, and how much of the reporting is genuinely decentralized versus operator-controlled.
- Confirm whether the feed uses time-weighted or median aggregation resistant to single-block manipulation, versus a raw spot price from one source.
- Understand what happens to your protocol if the oracle feed goes stale, disagrees internally, or is paused — do you have a fallback or circuit breaker?
- Verify the oracle has sufficient liquidity depth in its underlying sources for the specific asset; thin markets are the easiest to manipulate.
- Review the oracle's historical track record for outages, manipulation incidents, or governance changes that could affect long-term reliability.