What Is ‘Sandwiching’ in the Context of Decentralized Exchange (DEX) Front-Running?
Sandwiching is a specific type of front-running attack on a DEX, often involving an Automated Market Maker (AMM). An attacker sees a pending transaction (Victim Tx) in the mempool.
They place a buy order (Attacker Tx 1) right before the Victim Tx, which moves the price up. The Victim Tx executes at the worse, higher price (slippage).
The attacker then immediately places a sell order (Attacker Tx 2) right after the Victim Tx, profiting from the price difference.