Swapping, slippage and getting sandwiched
Two invisible costs sit on every on chain swap. Both are manageable once you know they exist.
Price impact is not slippage
Price impact is how much your own trade moves the price, because you are buying from a finite pool. On a thin pair a modest trade can move it several percent. This is a real cost and it is shown before you confirm.
Slippage tolerance is how much worse than quoted you will accept before the transaction reverts. It is a protection, not a cost.
Why setting slippage high is expensive
A high tolerance tells bots exactly how much room they have. A sandwich attack buys immediately before you, pushing the price up, lets your trade execute at the worse price, then sells immediately after. Your tolerance defined their profit.
How to protect yourself
- Use an aggregator that splits the trade across venues rather than a single pool.
- Use a venue with MEV protection. CoW Swap batches orders and returns surplus to you.
- Break large trades into smaller ones.
- Read the price impact figure before confirming, every time.
BEFORE YOU MOVE ON
Common questions
What is a sandwich attack?
A bot buys just before your trade to push the price up, lets yours execute at the worse price, then sells just after. Your slippage tolerance sets how much it can take.
What slippage should I set?
As low as will reliably execute. On a liquid pair a fraction of a percent is usually enough. Needing a large tolerance is a signal about the token, not a setting to accept.
Risk warning: crypto is highly volatile and largely unregulated. You can lose everything you put in. Nothing here is financial, investment or tax advice.
