Front-running
Front-running occurs when someone observes a pending action and gets a strategically related transaction executed before it to capture an advantage.
✦ Key Insight
Front-running can worsen prices, increase costs, or cause users' transactions to fail. It is especially relevant in decentralized trading, liquidations, NFT mints, and other applications where execution order changes economic outcomes.
✕ Common Misconceptions
Not every earlier transaction is malicious front-running. Normal arbitrage and independent users can also compete for execution. The key issue is whether someone uses knowledge of another pending action to gain an ordering advantage.
Detailed Explanation
Aliases and acronyms: Frontrunning; transaction front-running; priority transaction attack
In one sentence: Front-running occurs when someone observes a pending action and gets a strategically related transaction executed before it to capture an advantage.
Plain-English explanation: On public blockchains, pending transactions can reveal what a user is about to do. A searcher may submit a competing or related transaction with ordering incentives so it executes first. Front-running is one form of transaction-ordering behavior associated with MEV.
Analogy: It is like seeing someone reach for the last discounted item and quickly stepping ahead in line to buy it first.
How it works: A searcher monitors pending transactions or other order flow, detects a profitable opportunity, and submits its own transaction designed to execute earlier. Ordering may be influenced by fees, private builder relationships, bundles, or protocol-specific mechanisms.
FAQs
Q: Is front-running illegal?
A: Legal treatment depends on jurisdiction and facts. In blockchain discussions, the term primarily describes transaction-ordering behavior, not a universal legal classification.
Q: Can private transactions reduce front-running exposure?
A: They can reduce exposure to the public mempool, but they introduce different trust, routing, and infrastructure considerations.
Q: Is front-running the same as a sandwich attack?
A: No. A sandwich attack typically combines a transaction before and another after the victim's trade. Front-running is the earlier-ordering component.
Sources
In Practice
Dig Deeper
Slippage
Slippage is the difference between the price a trader expects when submitting an order and the actual price at which the trade executes. Slippage is common in crypto markets and is usually more noticeable during high volatility or when trading low-liquidity tokens.
Mempool
A mempool is a node's temporary pool of valid, unconfirmed transactions waiting to be included in a block.
