Skip to main content
T TON Adoption
← Glossary
NODE/03 · Term

Sandwich attack

MEV attack where a bot buys an asset just before a victim's swap and sells right after, pocketing the price difference as profit.

Aliases: sandwich, sandwiching

Sandwich attack is the most common MEV attack on DeFi users. A bot wraps your transaction with two of its own: buying before and selling right after. The victim eats elevated slippage; the bot captures the difference.

Step by step

You want to buy 10,000 USDT with TON. The TON/USDT pool holds 5,000 TON and 25,000 USDT (price 5 USDT/TON).

  1. Front-tx (bot). Bot spots your pending swap and runs its own TON → USDT first: deposits 1,000 TON and pulls 4,500 USDT. Pool price jumps to roughly 5.4 USDT/TON.
  2. Your swap. Executes at the moved price: your TON convert at 5.4–5.5 instead of 5. You receive less USDT.
  3. Back-tx (bot). Bot sells the 4,500 USDT back into the pool, taking out slightly more TON than it deposited initially.

TON_back − TON_front, minus gas and fees, is the bot’s clean profit. On large swaps this can run into hundreds of dollars per cycle.

Where it hits hardest

  • Large orders (>5–10% of pool size).
  • Thin pools (memecoins, fresh jettons).
  • Users with high slippage tolerance — literally an invitation to the bot. The higher the tolerance, the more it can extract.
  • Multi-hop routes — each hop is independently sandwichable.

Don’ts

  • Set tolerance at 5% “just in case” on a 10,000-USDT swap — the bot will harvest most of it.
  • Swap an entire position in one transaction on a thin pool.
  • Ignore “Minimum received” — that number is the real floor after a possible attack.

What helps

  • Tight slippage tolerance. 0.1–0.3% on stable pairs, 0.5–1% on a major jetton.
  • DEX aggregators. A split route is harder to wrap.
  • Order splitting over time. Ten swaps at 10% size often clear with smaller cumulative slippage.
  • Swap during quiet hours. Bot competition tends to dip at night UTC.

On TON, sandwich attacks are documented on large STON.fi and DeDust swaps. Volumes are smaller than Ethereum but the risk is real. Careful settings are the cheapest defence.

Related terms