The Slippage Desk

Home › Basics › Sandwich Attack vs Front-Running: Key Differences Explained

Sandwich Attack vs Front-Running: Key Differences Explained

Editorial team · Updated 2026-10-14 · 5 min read

Front-running places a transaction ahead of someone else’s to profit from the price move it expects. A sandwich attack front-runs and then adds a back-run right after the victim, locking in the gain. So every sandwich contains a front-run, but not every front-run is a sandwich.

Definitions side by side

Front-running means trading ahead of a known pending order. In traditional markets that can mean a broker trading on knowledge of a client order, which is widely prohibited. On public blockchains, pending orders are visible, so anyone can do it technically; the question is whether it is lawful and acceptable.

Back-running means placing a transaction immediately after a target to exploit what it changed. A common example is arbitrage after a large trade moves a pool’s price away from other venues.

Sandwiching combines the two around a single victim swap.

Tactic Position relative to target Typical goal Direct harm to target
Front-run Before Profit from expected price move Can worsen the target’s price
Back-run After Capture the state change Often none directly
Sandwich Before and after Extract the target’s slippage Yes, within their tolerance

Key takeaway: the back-run is what turns a front-run into a sandwich, letting the bot exit at the price the victim created.

Why the distinction matters

Terms get used loosely in articles and product pages, which causes confusion about what a tool does. CryptoMEV Bot, for instance, sells separate product pages for a front-run bot and the sandwich bot. Its explainer on what MEV bots do lists front-running, back-running and sandwich attacks as separate strategies and says sandwiching combines front-running and back-running around a victim’s trade. Reading those pages side by side is the easiest way to see how a vendor treats each.

For a trader, the practical effect depends on the tactic. A sandwich uses your slippage budget. A plain front-run can cost you through price movement. A back-run may leave you untouched. Hence defences vary slightly, though most overlap, as in how to avoid sandwich attacks.

The mechanics of each

Front-running

The searcher spots a large buy, buys first at a higher priority fee, and later sells at a higher price. The victim pays more, and may not notice. No second transaction is needed if the searcher is simply holding for the price lift, though many close the position later.

Back-running

The searcher waits for a state change and acts directly afterwards: for example, arbitraging a price gap a swap created, or liquidating a position that has just become under-collateralised. ethereum.org’s MEV page lists arbitrage and liquidations among the common forms of MEV.

Sandwiching

The bot front-runs, lets the victim’s swap execute at the worse price, then back-runs to sell. Because it brackets the victim, it can size the front-run to use nearly all the slippage allowed. See how a sandwich bot works for the sequence.

Regulators have long treated front-running in traditional securities as abusive where a duty or manipulative intent exists. On-chain, the picture is unclear, because there is typically no broker and no duty, and ordering is a property of the system. Whether sandwiching or front-running counts as manipulation in a given jurisdiction is unsettled; see is sandwich trading legal. Back-running arbitrage is generally regarded as the least controversial, since it tends to align prices across venues, a point the vendor’s own explainer makes when it calls arbitrage the most “legitimate” form of MEV.

Which one should an operator consider

Many operators prefer back-running strategies because they do not target a specific user’s loss. They still face fierce competition and costs. Our guide to sandwich bot alternatives covers these.

Quick test to tell them apart

Look at a block: if the same address trades before and after one other address’s swap in the same pool, it is a sandwich. If it only trades before, it is a front-run. If it only trades after, it is a back-run.

Examples in plain terms

Front-run only. A searcher sees a large pending buy of a token. It buys first with a higher fee and holds. After the large buy lifts the price, it sells later. No second transaction is tied to the victim’s block position.

Back-run only. A large swap pushes a pool’s price out of line with another venue. Right afterwards, an arbitrage transaction buys on the cheaper venue and sells on the dearer one. The original trader is not worse off because of it.

Sandwich. A large pending buy is surrounded: the bot buys first, the victim buys at the elevated price, the bot sells straight away. The victim’s output is close to its minimum.

Why vendors sell them separately

Different tactics need different logic. A front-run bot cares about identifying a price move and winning ordering; a back-run or arbitrage bot cares about price gaps across venues; a sandwich bot needs both and must compute a safe size that keeps the victim’s transaction valid. CryptoMEV Bot’s front-run bot page and its sandwich page reflect that split. If you are comparing tools, make sure you are comparing the same tactic, and that the page describes what actually happens at each step, as laid out in how a sandwich bot works.

What this means for defence

The practical advice for users overlaps: tighter slippage, smaller sizes and private routing reduce exposure to both. Where the tactics differ is in what you can observe afterwards. A sandwich leaves a clear pair of trades around yours, easy to confirm by following the explorer steps. A plain front-run leaves only a trade before yours, and its effect is harder to separate from normal price movement.

This article is educational and not financial or legal advice.

Frequently asked questions

Is a sandwich attack a type of front-running?

Yes, it includes a front-run, but it also adds a back-run after the victim’s trade to close out the position.

What is back-running?

Placing a transaction right after another to exploit the state it creates, such as an arbitrage after a large trade. It does not necessarily harm the other trader.

Which is worse for users?

Sandwiching typically extracts value from the victim’s slippage directly. Plain front-running can also worsen prices, while back-running often does not.

Do both need access to the mempool?

They need to see or anticipate the target transaction and influence ordering, which usually means the public mempool or private order flow.

Sources