CHARTTHREAD

Sandwich attack

A sandwich attack is when a bot sees your DEX swap waiting to be confirmed, trades just before you to push the price up, lets your swap fill at the worse price, and trades back right after you for a profit.

It works because pending swaps are visible to anyone and your slippage tolerance tells the bot how far it can push the price. On a $10,000 swap into a real LINK/WETH pool with a 1% tolerance, a sandwich costs you about $100. Defences: a tight tolerance, smaller swaps, deep pools, and wallets or routes that keep your transaction private until it is included.

Learn more: what slippage is.