Slippage on a DEX: your own trade moves the price, and the tolerance is the fence
On a decentralised exchange, a big swap moves the pool's price against you (price impact), and the price can also move while your swap waits for a block. The slippage tolerance you set is the worst result you accept; beyond it, the swap fails instead of filling.
Imagine a vending machine in the boomtown that swaps gold dust for coins. No clerk. Just two bins behind the glass, one of dust and one of coins, and a price that comes from how full each bin is.
Pour in a pinch of dust and the price barely moves. Pour in a sack and the coin bin empties as you pour. Every coin you take makes the next one dearer.
That is slippage on a decentralised exchange. Part of it is your own doing (price impact), part of it is what happens while you wait in line, and the "slippage tolerance" setting decides how much of both you are willing to swallow.
What it is
On an automated market maker, the price is set by the ratio of the two tokens in the pool. Your swap changes that ratio while it runs, so the average price you get is worse than the price on the screen. Uniswap's documentation calls this price impact and puts the rule plainly: "The greater the liquidity available at a given price, the lower the price impact for a given swap size" (Uniswap Developers, Swaps).
Slippage, in Uniswap's wording, is the change in price that can happen while your transaction is pending (Uniswap Support). Other trades land first. The pool you were quoted is not the pool you get.
The slippage tolerance is your fence. The app turns it into a minimum amount out. "If execution would return fewer output tokens than this value, the transaction reverts" (Uniswap Developers, Swaps).
The order-book version of slippage, where a market order eats through several price levels, is in "Order books explained". Here there is no book, only the curve.
How it works
Imagine a pool in the style of Uniswap v2, which charges a flat 0.30% fee on every swap (Uniswap Developers, Fees). It holds 1,000 ether and 2,000,000 USDC, so the screen shows 2,000 USDC per ether. The pool and the price are assumptions for the arithmetic, not a reading of a real pool.
The pool keeps the product of its two balances constant (the formula is in "Automated market makers explained"). Three swaps of USDC into ether:
- 1,000 USDC in: you get 0.4983 ether. Average price 2,007.02. That is 0.35% worse than the screen: 0.30% fee, about 0.05% price impact.
- 10,000 USDC in: you get 4.9603 ether. Average price 2,016.02, or 0.80% worse. Fee 0.30%, price impact 0.50%.
- 100,000 USDC in: you get 47.483 ether. Average price 2,106.02, or 5.30% worse. The fee is the same 0.30%; price impact has grown to 5%.
Ten times the trade, ten times the impact, roughly. The machine didn't cheat anyone. It just ran out of cheap ether.
Now the waiting line. You ask for the 10,000 USDC swap with a tolerance of 0.5%. The app quotes 4.9603 ether and sets the minimum at 4.9355.
Before your swap lands, someone else puts 50,000 USDC into the same pool. Your 10,000 USDC would now buy only 4.7222 ether, 4.8% less than the quote. That is below your minimum, so your swap reverts. You keep your USDC and lose only the gas.
With a tolerance of 5%, the same swap would have gone through at 4.7222. The fence was there. You had moved it.
Why it matters
Price impact is a cost you pay to the pool. It is the reason deep pools win trade and shallow ones don't. On a pool with a few thousand dollars in it, a modest swap can move the price by double digits.
Tolerance matters for a darker reason. A pending swap sits in the public mempool where bots can read it. A loose tolerance tells them exactly how much they can take from you before your swap would fail. That trade, the sandwich, has its own article: "MEV explained" (ethereum.org, MEV).
The shovel sellers here are the apps that pick a default tolerance for you. A default high enough that swaps rarely fail looks friendly. It is also a bigger gap for claim jumpers.
Where people get it wrong
- "Slippage is a fee." It isn't. The fee is fixed by the pool. Price impact depends on your size and the pool's depth, and slippage depends on what others do before you.
- "A higher tolerance gets me a better price." It only makes the swap less likely to fail. The price you accept can only get worse.
- "If the swap failed, nothing was lost." The gas for a reverted transaction is still paid.
- "The quote is the price." The quote is a snapshot of the pool. The block decides.
- "Splitting a trade into pieces makes impact disappear." In one pool, it doesn't: each piece moves the price for the next. Spreading across several pools can help, which is what aggregators do.
Read the minimum before you sign
Before you confirm a swap, look for the line called "minimum received" or similar. That number, not the big one at the top, is what you have agreed to.
If the price impact shown is more than a percent or two, the pool is too shallow for your trade. Swap less, or look elsewhere.
The vending machine is honest. It just doesn't care how big your sack is.
Frequently asked questions
What is the difference between price impact and slippage?
Price impact is how much your own trade moves the pool's price, and it is known before you sign. Slippage is the further change between the quote and the result, caused by other trades that land first. Both make your average price worse than the price on the screen.
What slippage tolerance should I set on a DEX?
There is no single right number. A tight tolerance protects you from bad fills and from bots but makes failed swaps more likely; a loose one does the opposite. Many traders keep it low for large, liquid pairs and only raise it when a swap keeps failing for a small amount.
Why did my swap fail with a slippage error?
The pool's price moved past your tolerance before your transaction was included, so the minimum amount out could not be met and the swap reverted. You keep your tokens, but the gas for the failed transaction is spent.
Does a bigger liquidity pool mean less slippage?
Yes, for the price impact part. The same swap moves a deep pool's price less than a shallow one's. It does not protect you from other trades landing before yours.
Is slippage the same as the trading fee?
No. On a Uniswap v2 pool, the fee is a flat 0.30% of the swap. Price impact comes on top of it and grows with the size of the trade relative to the pool.

