Price Manipulation Explained in Detail
Price manipulation is broader than oracle manipulation. The manipulated value can be a DEX price, LP token value, vault share price, collateral exchange rate, or internal accounting ratio.
The attacker profits when the protocol accepts the temporary price as real.
Smart contract example
uint256 collateralValue = collateralAmount * ammSpotPrice() / 1e18;
require(collateralValue >= debt * MIN_RATIO / 1e18, "unsafe");
If ammSpotPrice() can be moved before this check, the borrower can look safer than they are.
Price Manipulation in Auditing
Price manipulation is common in lending, vaults, AMMs, bridges, derivatives, liquidations, and reward systems. The bug often hides in assumptions about liquidity, timing, slippage, or exchange-rate stability.
Red flags in code
-
amountOutMin = 0or weak slippage bounds. -
Low-liquidity collateral with high borrowing power.
-
Vault share price used as collateral without testing donation and rounding edge cases.
-
Spot prices used for protocol-critical decisions.
-
Same-block mint, redeem, borrow, liquidate, or claim after a price move.
-
Decimal mismatch between tokens, shares, and price feeds.
How to test or review it
-
Move the price by realistic and extreme amounts on a fork.
-
Call borrow, mint, redeem, liquidate, or claim after the price move.
-
Test low supply, donated assets, high slippage, and low-liquidity pools.
-
Check whether price changes are bounded per block or per update.
-
Review all conversions between amount, shares, oracle price, and collateral factor.
-
Confirm user-facing swaps have slippage and deadline controls.
Keep learning this topic
Oracle Manipulation
Oracle manipulation occurs when an attacker distorts a data source that a smart contract trusts, causing the contract to make decisions from unsafe data.
Flash Loan Attack
A flash loan attack uses same-transaction borrowing to amplify an existing DeFi vulnerability, usually in pricing, collateral, governance, or accounting.
Sandwich Attack
A sandwich attack is a front-running pattern where an attacker places one transaction before and one after a victim trade to profit from the victim's price impact.
Oracle Manipulation & Price Manipulation
Oracle manipulation attacks distort price feeds, spot prices, and exchange rates. Learn Chainlink checks, TWAP defenses, and auditor review steps.
Smart Contract Audit Checklist
Use this SCH tool to turn the concept into practical audit work.
Practice this in real audit scenarios
Definitions help, but auditors need reps. SCH turns concepts like Price Manipulation into exploit labs, code review habits, and report-writing practice.
Start the free trial or see the full smart contract auditing course.