MEV protection vs slippage tolerance: How attacks use your limit
MEV protection vs slippage tolerance: neither works alone. Slippage caps sandwich losses; private routing hides your swap, while pair depth guides the trade-off.
Onchain Report Newsroom#2b6f944 min read
MEV protection and a tight slippage setting work best together: slippage caps what a sandwich attack can take, while private routing hides your pending swap from the public mempool.
How slippage and MEV protection work
A swap starts with an order and a minimum amount you are willing to receive. Slippage tolerance sets that minimum; if the swap would return less, the transaction reverts. A reverted transaction still costs gas.
When a pending swap sits in the public mempool, bots can read it before it is confirmed. A sandwich bot buys before your swap, lets your trade fill at a worse price, then sells after it in the same block. The bot aims to leave your fill just above your minimum received and keeps the difference.
That makes slippage a budget the bot can spend. Say you swap 10 ETH and allow 3% slippage. A sandwich can push the fill close to 3% below the expected amount while still passing your minimum. At 0.5%, the loss from that attack is capped near 0.5%, though a sharper limit can make the swap revert more often.
For background on how a decentralized exchange aggregator finds routes across liquidity sources, Matcha swap is an example of the kind of token exchange this choice applies to. The same trade-off matters wherever an order’s minimum received is visible before execution.
Which setting matters more for your trade?
Private routing sends a transaction to builders without putting it in the public mempool. That hides the pending trade from sandwich bots watching that pool, but it does not prevent ordinary price movement. You still need a slippage setting that gives the swap room to execute.
Flashbots Protect is one private-routing option. CoW Swap uses a different approach: solvers settle orders in batch auctions. Each changes how orders reach execution, while slippage still sets the minimum you will accept.
- Tight slippage: Limits how much a sandwich can move your fill, but raises the chance the transaction reverts and costs gas.
- Private routing: Hides the pending trade from the public mempool, reducing its visibility to sandwich bots, but does not shield against ordinary price changes.
- Pair liquidity: Deep, liquid pairs tend to need less room for price movement; thin or volatile pairs may need wider slippage, which gives a sandwich more room too.
For a small swap on a deep pair, few attacks may be worth attempting, so a sane slippage cap can be enough. For a large swap on the same pair, using private routing as well as a tight workable cap can reduce both visibility and the loss allowed by the minimum. On a thin pair, the price may move enough to make that tight cap fail.
In a constructed case, a swapper moving a large amount through a thin token pair could first compare how much the price may move with the minimum they can accept. Choosing private routing and a cap within that range helps limit sandwich exposure while showing when the swap is likely to revert.
Related
What is a sandwich attack in crypto?
A sandwich attack is a bot’s buy before and sell after your swap in the same block, arranged to profit from the worse price your trade receives.
What slippage should I set for a token swap?
Set a cap that allows for expected price movement on the pair without giving an attacker excess room. Then check the pair’s liquidity and trade size before deciding whether private routing is also worthwhile.
For your next swap, weigh its size and pair liquidity, then choose a workable slippage cap and decide whether private routing fits; that gives you a clearer balance between limiting loss and avoiding a failed transaction.