The Slippage Desk

Home › Running a Bot › Ethereum Sandwich Bot: Mempool, Builders and Gas Costs

Ethereum Sandwich Bot: Mempool, Builders and Gas Costs

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

An Ethereum sandwich bot reads pending swaps from the public mempool, simulates the price impact, and submits a front-run and a back-run around the victim, usually as a bundle sent to block builders with a payment for ordering. Gas, builder payments and competition decide whether any given attempt is worth it.

The Ethereum setup

On Ethereum and similar chains, a user signs a transaction and broadcasts it to nodes. Until a block includes it, the transaction sits in the public mempool, where anyone running a node can read it. Sandwich bots take advantage of that: they decode each pending call to a router such as a Uniswap-style contract, extract the token pair, amount and minimum output, and compute how much room the victim has left.

Since Ethereum moved to proof-of-stake, blocks are typically assembled by specialised builders and proposed by validators through relays. ethereum.org’s MEV page describes how this separation changes who captures extracted value. For a searcher, the effect is that ordering is now bought: you submit a bundle to builders with an effective payment, and the highest-value bundles tend to be included.

Gas, tips and the margin

A sandwich costs two transactions, and a swap is not a cheap transaction. Add the payment to the builder and the margin gets thin quickly.

Cost item When it is paid Effect on margin
Gas for the front-run If the bundle lands Fixed by network conditions
Gas for the back-run If the bundle lands Same again
Builder payment or priority fee When ordering is purchased Pushed up by rival searchers
Failed or reverted attempts Depends on route; bundles generally avoid paying for failures Bundle design matters
Infrastructure Always Nodes, simulation, monitoring

The vendor’s sandwich bot page describes a pre-trade simulation of whether slippage profit exceeds the gas costs of the two transactions. That is the right test, and on Ethereum it excludes many candidate trades, since only large, loosely protected swaps leave enough headroom.

Key takeaway: on Ethereum, gas and builder payments are the gatekeepers. Most pending swaps are simply not worth sandwiching.

Competition and the “dark forest”

Ethereum’s MEV scene has been competitive for years, and the dynamic is well documented: when an opportunity is visible, many searchers see it. The winners pay most of the surplus to the builder to be included. That is why operators who succeed usually have lower latency, better simulation or access that others lack. One public example of the scale of this contest is analysis of well-known bots, such as the vendor’s write-up on the jaredfromsubway bot; treat vendor analysis as one perspective and cross-check anything numeric on-chain.

How private routing changed the picture

Services such as Flashbots Protect and MEV Blocker let a user send a transaction to builders without exposing it to the public mempool. Flashbots’ documentation describes protection from frontrunning and sandwich attacks as a core purpose. If a growing share of flow travels this way, there are fewer visible targets for sandwich bots, and the remaining public-mempool trades become more important to them. That does not make sandwiching extinct. It makes the pool of exposed victims smaller and more heavily contested. For users, the implication is straightforward: see how to avoid sandwich attacks.

Reading an Ethereum sandwich on a block explorer

A sandwich leaves a recognisable footprint. In a single block, one address swaps into a token, the victim’s swap follows, and the same address swaps out, often in adjacent positions. The first and third transactions interact with the same pool, and the net balance of the bot’s address in the starting asset rises while the victim’s output sits near the minimum they set. Seeing that pattern is the simplest way to understand what a bot actually does, and our guide on checking whether you were sandwiched walks through it.

For an operator, the same footprint is a reminder that everything is public afterwards. Rivals study successful bundles, copy patterns and bid higher, so edges decay.

What changes if you run on other EVM chains

Layer-2 networks and other EVM chains handle ordering differently. Some use a single sequencer with first-come ordering, which changes the role of fee bidding; others have their own mempool rules. Do not assume that an Ethereum mainnet design transfers. The vendor page we reviewed does not state which chains its sandwich software supports, so ask before assuming support.

Practical questions for an operator

  • What is your actual access to the order flow: public mempool only, or additional private flow?
  • How do you simulate state at the target block, including other pending transactions?
  • What fraction of attempts land, and what do they net after all payments?
  • Who is liable for compliance in your jurisdiction? See is sandwich trading legal.

If those are unanswered, you are not ready to commit capital. For a view of alternatives that do not rely on harming a specific user’s trade, such as cross-venue arbitrage, see sandwich bot alternatives. CryptoMEV Bot also has an Ethereum arbitrage bot page if that is the direction you prefer.

Why the same chain can feel different over time

Fee markets, builder concentration, router behaviour and wallet defaults all shift. A strategy that looked comfortable in one fee environment may be unprofitable in another, and protective routing adoption by wallets changes the supply of targets. Any article that quotes fixed profit numbers for Ethereum sandwiching, including ones from vendors, should be read as a snapshot. Review current data from sources such as ethereum.org and block explorers before making decisions, and use the cost framework in what a sandwich bot costs.

Reading vendor claims against this setup

When a product page says its bot scans mempools and order books in real time, the Ethereum-specific questions are: whose mempool, and how fast? A hosted tool relying on a shared data source competes differently from one connected to your own nodes. The vendor’s sandwich bot page does not detail its data sources, so treat that as a question for the vendor, not an assumption.

This article is educational and not financial or legal advice.

Frequently asked questions

How does an Ethereum sandwich bot see my trade?

By reading pending transactions in the public mempool, decoding swaps on known DEX contracts and simulating their price impact.

Does private routing stop sandwich bots on Ethereum?

It can help a great deal, because a transaction that never enters the public mempool cannot be seen and targeted there. It does not protect against every route, so check what a service covers.

What are builders and relays?

Block builders assemble blocks from transactions and bundles, and relays pass them to validators. Searchers often submit bundles with payments to builders for ordering.

Is gas the main cost for an Ethereum bot?

It is a major one, along with payments to builders and infrastructure. On a busy network both legs can cost enough to remove thin margins.

Sources