What Are “Sandwich Attacks” and How Do They Relate to DEX Front-Running?
A sandwich attack is a specific form of front-running on a Decentralized Exchange (DEX), primarily targeting large trades on Automated Market Makers (AMMs). The attacker places two transactions: a "front-run" transaction just before the victim's trade, and a "back-run" transaction immediately after.
The front-run drives the price up (buying), the victim's trade executes at a worse price, and the back-run sells for a profit. The victim is "sandwiched" between the attacker's trades.