What is Front-Running?
Front-running in blockchain is the practice of placing a transaction ahead of a known pending transaction to profit from the anticipated price movement — enabled by the public nature of the mempool.
WHY IT MATTERS
Front-running is the canonical MEV attack. A searcher sees your pending swap in the mempool, submits the same trade with higher gas (to be included first), profits from the price impact your trade will cause, then sells after your trade executes.
In traditional finance, front-running by brokers is illegal. In crypto, it's a consequence of transparent mempools and permissionless block building — anyone can see and act on pending transactions.
Protections include private transaction submission (Flashbots), MEV-aware routing (CoW Protocol's batch auctions), and L2s with sequencer-ordered transactions that reduce front-running opportunities.