← All posts USTX

What Is a Sandwich Attack?

August 30, 2026 · by USTX Team
What Is a Sandwich Attack?

A sandwich attack is a form of MEV that can make your swap execute at a worse price. Here's how it works and how to protect yourself.

How the "sandwich" works

A bot spots your pending buy in the mempool. It:

  1. Buys just before you (front-run), pushing the price up.
  2. Lets your trade execute at that higher price.
  3. Sells just after you (back-run), pocketing the difference.

You're the "filling" — you get a worse rate so the bot profits.

How to reduce the risk

  • Set reasonable slippage — high slippage gives bots more room.
  • Use MEV-protection / private transaction features if your wallet or DEX offers them.
  • Avoid very large swaps in thin pools; split them up.

FAQ

Does this happen to every trade?

No — mainly larger or high-slippage trades in busy markets are targeted.

Is it a hack?

No — it exploits public pending transactions and slippage, not a vulnerability in your wallet.

Buy USTX Read more posts