What Is a “Sandwich Attack” and How Does It Utilize Mempool Visibility?
A sandwich attack is a type of front-running where an attacker places two transactions around a victim's pending transaction. The attacker first buys an asset just before the victim's large buy order executes, driving the price up.
Then, immediately after the victim's buy order executes at the inflated price, the attacker sells their asset, profiting from the price difference. This attack exploits the victim's price impact.