What is slippage tolerance?
The maximum price movement you will accept between submitting a trade and it executing, set as a percentage on decentralized exchange screens.
Not yet verifiedHow we verify
3 min read
In this entry
The maximum price movement you will accept between submitting a trade and it executing, set as a percentage on decentralized exchange screens.
Set it too low and the trade fails; set it too high and a sandwich attack can take the difference. It is the setting, while slippage is the outcome; see mev.
The confusion worth clearing up is that the number is not a prediction and not a fee. It is a limit written into the transaction itself, and the trade either respects it or reverts.
How it works
A swap on an automated market maker is executed by a contract at whatever price the pool holds when the transaction is mined, which can be seconds or minutes after you signed it. To stop that from being an open-ended commitment, the interface encodes a minimum acceptable output amount in the call. If the pool cannot deliver at least that amount, the contract reverts and you keep your input, minus the gas spent on the failed attempt.
Your tolerance percentage is what sets that minimum. A 0.5% tolerance on an expected output of 1,000 units encodes a floor of 995 units.
The adversarial case is what makes a high tolerance expensive. A searcher watching the mempool can place a buy in front of your transaction, pushing the price up to just inside your floor, let your swap execute at that worse price, and sell immediately behind it. The profit is bounded by exactly the room your tolerance gave away. That is a sandwich attack, and it is why a generous tolerance set to avoid failed transactions can quietly cost more than the failures would have.
Two further points. Tolerance is separate from price impact, which is the move your own order causes and is knowable before you sign. And a private transaction route that skips the public mempool removes the sandwich exposure without changing the tolerance at all.
Example
Illustrative. You swap for an expected 1,000 units with a 0.5% tolerance, so the contract will accept nothing below 995. A searcher can push the price against you only until you would receive 995, and their profit is capped near those 5 units. Raise the tolerance to 5% and the floor drops to 950, so the same attack can now extract close to 50 units, ten times as much, from the same trade. Nothing about the market changed. The setting did.
Why it matters when you buy
Buying on a decentralized venue means you are the one setting this, whereas on a centralized exchange the equivalent decision is choosing a market order over a limit order. The liquidity pages show measured spreads and depth so you can see whether a market is thin enough for the setting to matter, and the guide comparing centralized and decentralized venues covers the trade-offs.
Related terms
- slippage — the outcome this setting caps
- sandwich attack — what a wide tolerance funds
- mev — the broader extraction this belongs to
- price impact — the part of the move your order causes
- automated market maker — the venue type that needs the setting
- dex — where you will see the field
Questions
What tolerance should I use?
There is no universal number, and any interface that suggests one is guessing at your market. Start from the price impact the interface already shows you for the trade, and treat anything far above it as room you are giving away.
Why did my swap fail and still cost gas?
The contract reverted because the output fell below your floor, but the transaction was still executed and included, so the network charged for the computation. See gas.
Does this exist on centralized exchanges?
Not as a setting. The equivalent control is order type: a limit order fixes your worst acceptable price, a market order accepts whatever the book gives. See limit order.