Front-running is the practice of placing a trade ahead of a pending order that one knows about, in order to profit from the price change that order is likely to cause. In traditional securities markets the classic case is a broker who learns of a large client order and buys or sells for their own account first; this misuse of confidential client information is prohibited. On public blockchains the term describes bots that watch pending transactions and pay to have their own transactions processed first.
Front-running is a form of market manipulation or abuse of position, related to but distinct from insider trading, which uses non-public information about the issuer rather than about orders. In crypto it is part of a wider set of strategies known as maximal extractable value (MEV), which includes sandwich attacks and arbitrage. Whether blockchain front-running is unlawful depends on the facts and jurisdiction.
Front-running in plain terms
Imagine you tell a shop assistant that you are about to buy every remaining concert ticket for a sold-out show. Before you reach the till, the assistant quietly buys the last few tickets for themselves, then offers to sell them to you at a higher price. They made money only because you trusted them with your plan.
That is front-running. In a stock market the assistant is a broker who sees a client's big order. On a blockchain there is no assistant, but every order waits in a public queue before it is processed, and anyone can read the queue. Automated programs spot large trades there and pay a little extra to jump ahead, buy first, and profit when the original trade pushes the price up.
Front-running in traditional markets
In securities and futures markets, front-running typically involves a firm or employee who knows of an imminent customer order large enough to move the price. Trading ahead of it breaches the duty the firm owes the customer. In the United States, FINRA Rule 5270 prohibits member firms from trading a security, or related options or futures, while in possession of material non-public information about an imminent block transaction, and FINRA and the Securities and Exchange Commission (SEC) have brought enforcement actions over such conduct. Similar duties apply under market-abuse rules elsewhere, including in the UK and EU.
Related practices include trading ahead of research reports and "tailgating", trading right after a client order. Firms address the risk with information barriers, surveillance of employee trades and best-execution policies. Not all speed-based trading is front-running: high-frequency trading (HFT) firms that react quickly to public market data are generally lawful, though they have been criticised for similar effects.
Front-running on blockchains
On most public blockchains, a transaction is broadcast to the network and waits in the mempool before a miner or validator includes it in a block. Anyone running a node can see these pending transactions, including large trades on a decentralized exchange (DEX). A bot that spots a profitable pending trade can submit its own transaction with a higher gas price or tip, so that block producers order it first.
The 2019 research paper "Flash Boys 2.0", by Philip Daian and co-authors, documented bots competing in "priority gas auctions" to front-run trades on Ethereum DEXs and introduced the term miner extractable value for the profit available from choosing which transactions go into a block and in what order. After Ethereum moved to proof of stake (PoS), the term was generally recast as maximal extractable value, since validators rather than miners now order transactions. Related bots include the sniper bot, which races to buy newly listed tokens, and wider crypto trading bots.
Sandwich attacks
The most common front-running pattern on automated market makers (AMMs) is the sandwich attack. In an AMM, a large purchase moves the price along a fixed formula, so the trader accepts some slippage up to a tolerance they set. A sandwich bot exploits that tolerance in three steps:
- The bot buys the same token just before the victim's trade, pushing the price up.
- The victim's trade executes at the worse price, still within their slippage limit, pushing the price up further.
- The bot sells straight after the victim, capturing the difference minus fees.
For example, a user who sets a 3% slippage tolerance on a large swap may receive almost 3% fewer tokens than quoted, with much of that difference taken by the bot. Not every reordering harms users: "back-running", in which a bot trades just after a transaction to perform arbitrage between pools, mostly restores prices across markets.
Defences and legal status
Users and protocols limit front-running in several ways:
- Tight slippage settings and limit orders reduce how much a bot can take from any one trade.
- Private transaction relays send transactions directly to block builders instead of the public mempool, a service popularised by Flashbots.
- Commit-reveal schemes and batch auctions hide or group orders so that no single order can be traded ahead of.
- Rollups on Layer 2 networks often use a single sequencer that orders transactions first-come, first-served, which changes but does not remove the problem.
The legal position of blockchain front-running is still developing. Many MEV strategies use only public data and no duty of trust, which separates them from broker front-running. In May 2024, however, US prosecutors charged two brothers with exploiting the block-building process to take about $25 million from other traders' MEV bots, which prosecutors described as a first-of-its-kind manipulation of the Ethereum blockchain; the brothers denied wrongdoing. Front-running also differs from a wash trade, in which a trader buys from and sells to themselves to fake activity: front-running exploits another person's genuine order rather than inventing volume.