Sandwich Attack
A sandwich attack is a specific type of frontrunning where an attacker surrounds a victim's transaction with two of their own transactions. First, the attacker buys an asset just before the victim's trade, which pushes the price of the asset up.
The victim's trade then executes at this higher price, causing significant slippage for the victim. Finally, the attacker sells the asset immediately after the victim's trade, capturing the profit from the price increase caused by the victim's order.
This strategy effectively traps the victim in the middle, forcing them to execute at a disadvantageous price. Sandwich attacks are highly prevalent in automated market makers and represent a significant cost to retail traders who do not use protective measures.
It is a classic example of exploiting information asymmetry in the mempool.