Skip to free scan
critical

Price Manipulation in Smart Contracts

April 1, 2026Updated September 15, 2026
Chainsethereumarbitrumbaseoptimismpolygonbnb-chain
Review toolsechidnahound-ai

Severity depends on reachable impact and deployment context. Listed tools are review aids; their applicability depends on language, version and configuration.

Price manipulation is the deliberate movement of a reference market so another contract values assets incorrectly. An attacker may trade against a thin pool, alter reserves used by a naive spot-price calculation, or sustain a distorted price over an averaging window. The manipulated trade may lose money on the venue; the attack succeeds when profit from borrowing, minting, liquidating, or redeeming elsewhere exceeds that cost.

This overlaps with oracle manipulation. “Price manipulation” describes control of the underlying market; “oracle manipulation” also covers stale, misconfigured, or corrupt reporting even when no market trade occurs.

ATTACK CONDITIONS

The dangerous pattern is a large, price-dependent exposure backed by a reference market that is cheap to move. Spot reserve ratios are especially fragile because a transaction can move the pool, consume the distorted value, and reverse the trade atomically. Flash loans reduce capital requirements but are neither necessary nor the root cause.

A time-weighted price raises the cost by requiring influence over time. Uniswap's OracleLibrary computes time-weighted tick and liquidity values over a specified lookback; the consumer still chooses the pool and window. A long window can lag a genuine market move, while a short or illiquid window may remain cheap to manipulate.

REVIEW AND TEST

Map every place a price changes solvency or transfers value. Record the reference venues, observation window, available liquidity, maximum protocol exposure, and whether the same assets appear on both sides of the calculation. Avoid treating total value locked as executable liquidity.

Build an economic test that moves the actual reference market, calls the consumer, unwinds the trade, and accounts for fees, slippage, liquidation bonuses, caps, and repayment. Sweep trade sizes and time windows. Test empty or newly created pools, concentrated liquidity outside the active range, stale observations, correlated venues, and a reference asset that depegs.

The Chainlink feed-selection guidance emphasizes matching a feed's market coverage and risk properties to the application. The same discipline applies to any reference: source quality and protocol exposure must be considered together.

MITIGATIONS AND LIMITS

  • Use manipulation-resistant observations with a documented pool, window, and liquidity requirement.
  • Cap borrowing, minting, redemption, and liquidation exposure relative to reference-market depth.
  • Compare independent references when the response to disagreement is clearly defined.
  • Apply bounded deviation controls and a tested pause or fallback path.
  • Delay or stage unusually large operations when atomic settlement creates excessive exposure.
  • Monitor the deployed reference addresses, liquidity, observation capacity, and parameter changes.

Whitelisting a token does not make its market liquid, and a median is only independent when its inputs are.

Firepan can review submitted source for spot-price dependencies, price-to-value flows, missing caps, and weak observation logic. It cannot establish live manipulation cost or certify deployed liquidity without current on-chain and market evidence.

FREQUENTLY ASKED QUESTIONS

Does a TWAP make manipulation impossible?

No. It changes the cost and duration required. Window length, liquidity, exposure, and market volatility still determine safety.

Is a flash loan proof of a vulnerability?

No. It is a financing tool. The vulnerability is an economically unsafe price dependency.

Firepan

Scan Your Contracts Now

Run a free scan — results in minutes, no credit card required.

Run Free Scan →