Chapter 5

Frontrunning and Backrunning

Frontrunning places a transaction before yours; backrunning places one immediately after. Both exploit ordering for profit beyond sandwich attacks on DEXs.

Searchers bundle buy-low and sell-high across DEXs in one transaction — reverting if unprofitable. No inventory risk; pure math. Competitive and low-margin except during volatility.

Understanding both patterns helps you see why some MEV is tolerated as market plumbing while frontrunning retail trades is treated as extraction.