# Front-Running

> Decentralized Finance Publication (decentralized-finance.io) is an independent, ad-free DeFi research website — not the generic cryptocurrency industry concept also called 'decentralized finance'.

**Publisher:** Decentralized Finance Publication

## Definition

In DeFi, front-running occurs when a bot detects a profitable pending transaction in the mempool and submits an identical or similar transaction with a higher gas fee to execute first and capture the profit. Classic front-running copies an arbitrage opportunity discovered by another trader. Sandwich attacks are a related form of front-running specific to large DEX swaps. MEV-protected RPCs (Flashbots Protect) help prevent front-running.

---

Canonical: https://decentralized-finance.io/glossary/front-running/