What Is a “Sandwich Attack” and How Does It Relate to Arbitrage in AMM Pools?
A sandwich attack is a form of front-running where a malicious actor identifies a pending transaction and places two of their own transactions, one before and one after the victim's transaction. The first transaction drives up the price for the victim, and the second transaction sells the asset at the new, higher price, extracting a profit.
This is a predatory form of arbitrage that exploits the transparency of public blockchains and can result in significant losses for the victim.