How Do “Sandwich Attacks” Exploit the Price Changes Caused by Large Trades in an AMM?

A sandwich attack involves a malicious actor detecting a large pending trade in the mempool. The attacker executes a small buy order just before the large trade (the "front-run"), driving up the price.

The large trade then executes at the higher, front-run price, incurring more slippage. Immediately after, the attacker executes a sell order (the "back-run") at the newly inflated price.

The attacker profits from the price movement caused by the victim's trade, and the victim pays a higher execution price.

What Is a “Sandwich Attack” and How Does It Exploit the AMM Structure?
Explain the Concept of “Sandwich Attacks” as a Specific Type of Front-Running
What Are “Sandwich Attacks” in the Context of MEV?
What Is ‘Sandwich Attack’ and How Does It Exploit the AMM Slippage Mechanism?
What Is the Role of a “Sandwich Attack” in Exploiting Liquidity Pools?
What Are the Different Types of MEV Attacks besides Front-Running?
What Is a “Sandwich Attack” in the Context of AMM Arbitrage?
What Is a “Sandwich Attack” and How Does It Exploit the Actions of Other Traders in an AMM?

Glossar