Sandwich Attack Mechanics
Sandwich attack mechanics describe a specific form of MEV where a searcher identifies a large pending trade on a decentralized exchange and places a buy order immediately before it and a sell order immediately after it. The large trade drives the price of the asset up, allowing the attacker to sell their position at a profit while the original trader suffers from increased slippage.
This process relies on the transparency of the mempool, where transactions wait to be included in a block. Searchers pay higher gas fees to ensure their transactions are prioritized by validators, effectively "sandwiching" the victim's trade.
This activity is a major concern for retail users who face worse execution prices than expected. To combat this, many users are turning to private transaction relays that bypass the public mempool, making it harder for sandwich bots to detect and front-run their trades.