What Is Front-Running in the Context of Decentralized Exchanges?

Front-running on decentralized exchanges (DEXs) occurs when an attacker observes a profitable transaction pending in the public mempool. The attacker then copies this transaction but submits their own with a higher transaction fee (gas).

This incentivizes network validators to process the attacker's transaction first. The attacker profits from the price movement caused by the victim's original, now-delayed transaction.

This is a common form of Maximal Extractable Value (MEV).

How Does Maximal Extractable Value (MEV) Relate to Front-Running in DeFi?
What Role Does Transaction Transparency in the Mempool Play in Enabling Front-Running?
How Does Front-Running Relate to MEV and Fair Transaction Ordering?
What Is a “Front-Running” Attack in DeFi and How Does It Undermine Trustless Execution?
What Is the Difference between Front-Running on a CEX versus a DEX?
What Is a “Front-Running” Attack in the Context of a Low-Throughput Chain?
What Is the Risk of Front-Running in Decentralized Options Trading?
What Role Do Gas Fees Play in the Profitability of a Front-Running Attack?

Glossar