What is slippage, and how does it differ between centralized exchanges and AMMs?
Slippage broadly refers to the gap between the expected and actual execution price, but the root causes are completely different in centralized exchanges (CEX) and decentralized AMMs.
In a CEX order book, slippage mainly comes from insufficient liquidity: if the quantity you want to buy exceeds the amount at the best current ask, the system fills your order at progressively worse prices. Deeper liquidity and more standing orders mean less slippage.
AMMs like Uniswap work differently: prices are determined by formulas like x × y = k, and every trade shifts the asset ratio in the pool, which shifts the price. Larger trades have a greater impact on the ratio, causing your average execution price to deviate more from the price at the start of the trade. This price movement caused by your own trade changing the pool state is called Price Impact — the core mechanism behind AMM slippage.
How should slippage tolerance be set, and what are the risks of setting it too high or too low?
AMM trades typically let you set a "maximum acceptable slippage" (slippage tolerance). If you set 0.5%, it means the trade automatically fails (reverts) if the actual execution price deviates more than 0.5% from expected.
Setting too low: when markets are volatile or pool depth is insufficient, your trade may fail repeatedly. You resubmit repeatedly, paying gas each time without success — wasting fees and failing to complete the swap.
Setting too high: your trade succeeds easily, but you may execute at a very poor price. More seriously, this makes you an ideal sandwich attack target — attackers see your large order with loose slippage tolerance and know they can safely bracket you with front-run and back-run orders to extract profit.
Practical balance: small trades can use 0.5–1%; for large trades, it's better to split the order into smaller pieces than to widen the slippage tolerance.
What is the relationship between slippage and MEV/sandwich attacks?
Slippage tolerance is a key parameter in whether a sandwich attack succeeds.
Sandwich attack mechanics: an attacker sees your pending large trade in the mempool and observes your slippage tolerance setting. If you've set 2% tolerance, the attacker knows they can front-run your trade (paying higher gas to get miners to prioritize their transaction), worsening your execution price — but as long as the gap stays under 2%, your trade still succeeds. The attacker captures that 2% headroom.
The looser the slippage, the more room attackers have to operate and the higher the sandwich risk; the tighter the slippage, the lower the sandwich probability, but transaction failures become more likely.
Countermeasures: use private transaction pools like Flashbots (transactions don't appear in the public mempool), so attackers can't see them in advance.
How can users reduce unnecessary slippage losses in practice?
Slippage cannot be eliminated entirely, but several concrete steps can reduce its impact:
(1) Choose pools and DEXs with deep liquidity — the same trade size produces far less slippage in a deep pool than a shallow one. Uniswap V3's concentrated liquidity is typically deeper than V2 on popular pairs.
(2) Split large trades — break one large trade into multiple smaller ones sent in batches; each transaction has less impact on the pool, reducing total slippage.
(3) Use DEX aggregators — 1inch, Paraswap, and similar aggregators split your order across multiple liquidity pools while finding the best price, typically reducing slippage more effectively than a single DEX.
(4) Avoid periods of extreme market volatility — during sharp moves, pool depth shrinks relative to effective demand, and slippage typically runs higher.
(5) Use private transaction pools — services like Flashbots Protect keep your transaction out of the public mempool, avoiding the artificial slippage caused by sandwich attacks.
Suppose an ETH/USDC pool holds 1,000 ETH and 2,000,000 USDC, with a current price of roughly $2,000/ETH. If you buy 10 ETH ($20,000) in one trade: the pool formula shifts the ETH ratio upward, so your actual execution price might be around $2,020–$2,040 — roughly 1–2% slippage. If you instead buy 100 ETH ($200,000), that trade size is a large fraction of the pool's liquidity; slippage could spike above 10%, with an average execution price potentially above $2,200 — a vivid illustration of why large orders in shallow pools suffer severe slippage.
AMM slippage enables protocols to provide automated liquidity without centralized market makers, but also makes large traders bear higher slippage costs than on CEXs. Concentrated liquidity (Uniswap V3) can dramatically reduce slippage in specific price ranges, but requires liquidity providers to actively manage positions, raising the technical bar. Slippage is fundamentally a "cost of using the pricing curve service" — deeper liquidity means lower cost.