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).