#1 BTC $80,499.54 -0.17% #2 ETH $2,341.99 -1.24% #3 USDT $0.9991 +0.01% #4 BNB $735.15 -0.20% #5 XRP $1.29 +0.38% #6 USDC $1.00 +0.02% #7 SOL $101.54 -0.58% #8 TRX $0.3290 -0.20% #9 STETH $2,330.79 -1.86% #10 ZEC $1,197.59 +2.37%

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

FeatureChainlinkPyth
ModelPushPull
UpdateDeviation/heartbeat~400 ms off-chain
DataMedian of nodesAggregate 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