Trail notes
- Blockchains can’t look up outside information on their own; oracles deliver it, most often as price feeds.
- Lending protocols use oracle prices to value collateral and decide when loans are liquidated.
- A price read from a single thin trading pool can be pushed around within one transaction.
- Stale, delayed or misconfigured feeds can cause wrongful liquidations or let bad loans through.
- Check which oracle an app uses, how often it updates and how the app reacts if the feed fails.
The oracle problem
Smart contracts are deliberately isolated. Every node must reach the same result from the same inputs, so a contract can’t simply browse a website or call a bank’s system to learn today’s price of Ether. If it did, different nodes might see different answers.
An oracle solves this by putting outside data onto the blockchain as a transaction. Once the data is recorded on-chain, every contract sees the same value. Prices are the most common use, but oracles also deliver interest rates, random numbers, sports results, weather data and attestations about reserves held elsewhere.
The catch is trust. A contract that relies on an oracle is only as accurate and honest as the oracle. If the data is wrong, the contract will act on it exactly as written.
How price feeds work
A well-designed price feed avoids relying on any single source or operator. Common features include:
- Several independent node operators each fetch prices and report them.
- Several data sources, such as multiple exchanges and data providers, feed each operator.
- Aggregation, often a median, so one bad report can’t move the result much.
- Update rules: a new price is posted when it moves more than a set percentage (the deviation threshold) or when a set time passes (the heartbeat).
- Push or pull delivery: some feeds post updates on a schedule, others let an application pull a signed price at the moment it needs one.
Some applications skip outside feeds and read prices from on-chain trading pools instead, often as a time-weighted average price (TWAP) over a window. A TWAP is harder to manipulate than an instant price, but it also lags fast-moving markets.
Why lending depends on oracles
A lending protocol lets you borrow against collateral. It needs to know, at every moment, whether your collateral is still worth enough. That value comes from an oracle. When the oracle price drops far enough, your position becomes eligible for liquidation: someone repays part of your loan and takes some of your collateral at a discount.
The oracle doesn’t cause the market move, but it decides when the contract reacts. A feed that updates too slowly can leave risky loans open; a feed that spikes on bad data can liquidate healthy ones. Our health factor infographic and liquidation risk explainer show the mechanics.
Manipulation and failure modes
- Thin-pool manipulation. If a protocol reads the instant price from one small trading pool, an attacker can make a large trade, often with a flash loan borrowed and repaid in the same transaction, to distort that price, borrow against the inflated value and leave.
- Stale prices. If updates stop because of network congestion or an outage, contracts keep using an old price while markets move.
- Misconfiguration. Wrong decimals, a feed for the wrong asset or a feed that assumes a stablecoin is always worth exactly $1 can all misprice collateral.
- Operator compromise. A feed controlled by one key or a few operators can be changed by whoever controls them.
- Illiquid assets. For small tokens, even honest feeds can reflect prices that only a handful of trades produced.
When a stablecoin loses its peg, oracles and protocols must decide whether to report the market price or a fixed value. Either choice can cause losses. The TerraUSD (UST) algorithmic stablecoin lost its peg in May 2022, a reminder that “stable” prices can move fast.
Our oracle manipulation explainer covers these attacks in more depth.
How protocols defend themselves
Careful protocols layer several defences. They use aggregated feeds rather than single pools, compare a primary feed against a backup and pause or reject prices that move too far too fast. They set lower borrowing limits on volatile or illiquid assets and cap how much of one asset can be used as collateral. Some add delays before large changes take effect.
None of these removes oracle risk. Circuit breakers can freeze activity during real crashes, and fallback feeds bring their own assumptions. The aim is to make manipulation expensive and failures survivable, not impossible.
Governance matters here too. Whoever can change an application’s oracle settings, through an admin key or a token vote, can in effect change the prices it trusts. When you read about a protocol’s price feeds, also check who is allowed to switch them and whether there is a delay before a switch takes effect.
How to check before you rely on it
- Find the application’s documentation on price sources. Reputable protocols say which oracle prices each asset.
- Check whether prices come from aggregated feeds, on-chain averages or a single pool.
- Look for the update rules: deviation threshold and heartbeat.
- Ask what happens if a feed stops updating or reports an extreme value.
- Be extra cautious with collateral that trades thinly.
- Leave a generous buffer between your position and the liquidation level.
As of 2026-10-30, CDIC does not cover crypto-assets, including stablecoins, and no Canadian compensation scheme applies to a DeFi liquidation. If you are liquidated, record the event with its date, amounts and CAD values; CRA has published no DeFi-specific guidance on lending, so ask a tax professional how it applies to you.
Your checklist
Questions people ask
What is a blockchain oracle?
An oracle is a service that puts outside information, most often asset prices, onto a blockchain so smart contracts can use it. Contracts can’t fetch outside data themselves, so they depend on oracles for it.
Why do lending protocols need oracles?
Lending protocols need current prices to value collateral and decide when a loan becomes risky enough to liquidate. Without a reliable price feed, they could not tell healthy loans from unsafe ones.
How can an oracle be manipulated?
The most common way is to distort the price in a small trading pool that a protocol reads directly, often using a flash loan, and then borrow against the false price. Aggregated feeds and time-weighted averages make this harder.
Can an oracle error liquidate my loan?
Yes. If a feed reports a wrong or sharply lower price, a protocol may liquidate your position automatically, and the transaction is final. A large collateral buffer reduces this risk.
Sources and dates
- Oracles — ethereum.orgreference
No date shown on page · checked 2026-10-31. How off-chain data reaches smart contracts, and oracle risks. - Decentralized finance (DeFi) — ethereum.orgreference
No date shown on page · checked 2026-10-31. Overview of DeFi building blocks on Ethereum. - Stablecoins — ethereum.orgreference
No date shown on page · checked 2026-10-31. Fiat-backed, crypto-backed and algorithmic stablecoin designs. - What's covered — Canada Deposit Insurance Corporationin force
No date shown on page · checked 2026-10-30. Up to $100,000 per category per member institution; cryptocurrencies, including stablecoins, are not covered. - Information for crypto-asset users and tax professionals — Canada Revenue Agencyin force
Page date 2025-10-29 · checked 2026-10-30. CRA's current crypto-asset guidance set (replaced the older 'Guide for cryptocurrency users').
Education only. Nothing on this page is financial, investment, tax or legal advice, or a recommendation to buy, sell, stake, lend or borrow any crypto-asset. Crypto-assets can lose some or all of their value and are not covered by CDIC. Canadian rules change: check the dated sources above and talk to a qualified professional about your situation. Full disclaimer.
