Blog / Market & On-Chain Guides
How Oracles Prevent Price Manipulation: A Practical Guide
A clear, data-driven guide to how oracles prevent price manipulation.
The oracle problem
Smart contracts cannot read off-chain prices. If a lender uses a single DEX price, an attacker can push that price with a flash loan, borrow against inflated collateral and leave bad debt.
Chainlink's push model
Chainlink data feeds aggregate prices from many independent node operators and update on-chain when deviation exceeds a threshold, such as 0.5 percent, or a heartbeat elapses, often one hour.
Pyth's pull model
Pyth publishers, including exchanges and trading firms, stream prices to Pythnet every 400 ms. Users pull a signed update into their transaction and pay the update fee, which provides confidence intervals as well as prices.
Historic manipulations
Mango Markets lost about $114 million in October 2022 when its MNGO oracle price was pumped on thin markets. bZx suffered flash-loan oracle attacks in February 2020.
Defenses
Time-weighted average prices, circuit breakers, multiple sources and caps on collateral for illiquid tokens reduce manipulation risk.
By the numbers
For How Oracles Prevent Price Manipulation, the reference figures are topic of How Oracles Prevent Price Manipulation, level of Intermediate, updated of 2026. The comparison table below lines up feature, chainlink, pyth — Model: Push / Pull; Update: Deviation/heartbeat / ~400 ms off-chain; Data: Median of nodes / Aggregate with confidence.
Modeling How Oracles Prevent Price Manipulation with the DEX Price Impact Slippage Calculator
The DEX Price Impact Slippage Calculator takes three inputs — Trade size ($), Pool liquidity ($), Fee (%). Impact ≈ trade ÷ (reserve + trade) + fee. With its default inputs (Trade size ($) = 50000; Pool liquidity ($) = 2000000; Fee (%) = 0.3) it returns 5.06 %; swap in the figures from How Oracles Prevent Price Manipulation above to reproduce the scenario yourself.
Modeling How Oracles Prevent Price Manipulation with the Lending Health Factor Liquidation Calculator
The Lending Health Factor Liquidation Calculator takes three inputs — Collateral ($), Liq. threshold (%), Debt ($). Health factor = collateral × LT ÷ debt. With its default inputs (Collateral ($) = 10000; Liq. threshold (%) = 82; Debt ($) = 5000) it returns 1.64 HF; swap in the figures from How Oracles Prevent Price Manipulation above to reproduce the scenario yourself.
Data Table
| Feature | Chainlink | Pyth |
|---|---|---|
| Model | Push | Pull |
| Update | Deviation/heartbeat | ~400 ms off-chain |
| Data | Median of nodes | Aggregate with confidence |
Frequently Asked Questions
Why not use a DEX price?
Thin DEX liquidity can be manipulated within one transaction.
What is a heartbeat?
Maximum time between updates.
What caused Mango's loss?
Manipulating its own token's oracle price.
Related Calculators
Related Tokens
Related Articles
For educational and informational purposes only. Not financial, investment, tax or legal advice. Figures are approximate and historical; crypto assets are volatile and you may lose capital. Do your own research.