Front-running in crypto happens when someone sees a pending transaction before it is confirmed and gets their own transaction included ahead of it, to profit from the price change the original transaction will cause. It is possible because on many public blockchains, pending transactions are visible before they are added to a block, and whoever builds the block decides their order.
Last updated: October 27, 2026.
How does front-running happen?
On many public chains, a signed transaction is broadcast to the network and waits with other pending transactions, often called the mempool, until a block producer includes it. While it waits, anyone watching the network can read it.
A bot that sees a large buy on a decentralized exchange can send its own buy with a higher fee, so that it is ordered first. A well-known version is the sandwich attack: one transaction just before the user's trade and one just after it. The user's trade executes at a worse price, within the slippage limit the user set, and the attacker sells into the higher price.
What is MEV?
Maximal extractable value (MEV) is the value that can be captured by including, excluding, or reordering transactions in a block. Front-running is one form of it. Back-running is another, where a transaction is placed right after a target, for example to arbitrage a price gap that the target creates. Liquidations of loans that fall below their collateral requirement are a third.
Not all MEV harms the user it touches. Arbitrage that brings prices on different venues back in line is also MEV. Front-running and sandwich attacks are the forms that take value directly from the user whose transaction was seen.
How do trading systems reduce front-running?
| Approach | How it works | What it changes |
|---|---|---|
| Slippage limit | The trade fails if the price moves past a limit the user set | Caps how much a sandwich can take |
| Private transaction submission | The transaction goes to block builders instead of the public mempool | Bots watching the mempool cannot see it |
| Batch auction | Orders in a batch clear together at one price | The order inside the batch no longer matters |
| Commit-reveal | The user first commits to a hidden order, then reveals it | The contents stay hidden until the order is fixed |
| Encrypted mempool | Transactions stay encrypted until their order is set | Ordering happens before anyone can read them |
Each approach moves trust somewhere. Private submission relies on the builder or relay that receives the transaction not to misuse it. Batch auctions and intent-based systems rely on the auction or the solvers to deliver a fair result.
FAQ
Is front-running the same as MEV?
No. MEV is the full set of value that comes from ordering transactions. Front-running is one way to capture it, and some other forms, such as arbitrage, do not take value from a specific user.
Does a slippage limit stop a sandwich attack?
It limits the loss but does not hide the trade. A tight limit leaves less room for an attacker, but the trade is more likely to fail if the price moves for ordinary reasons.
Can cross-chain transactions be front-run?
A cross-chain action is made of transactions on each chain involved, and each one is ordered by that chain's block producers. A trade on the destination chain can be seen and front-run there like any other transaction, so its slippage limit matters as much as the one on the source chain.
Build with transaction ordering in mind
For tools to build applications that work across chains, see LayerZero developer resources.