coinmarketguy/Blog
EducationSeptember 28, 2026· Updated October 2, 2026

What Is MEV? Maximal Extractable Value and Sandwich Attacks Explained

MEV, or Maximal Extractable Value, lets miners and validators profit by reordering transactions in a block. This guide explains how it works and why sandwich attacks cost DeFi traders real money.

GA
Founder, CoinMarketGuy

Maximal extractable value, or MEV, is the profit that can be made by choosing which transactions go into a block and in what order. Whoever builds a block can include, exclude or reorder transactions, and that power is worth money. The ethereum.org MEV documentation defines it as the maximum value that can be extracted from block production beyond the standard block reward and gas fees.

The term started as miner extractable value, because miners ordered transactions under Proof of Work. It was renamed maximal extractable value as Ethereum moved to Proof of Stake, where validators took over that role. The concept became widely known through the 2019 research paper Flash Boys 2.0, which documented bots competing to front-run trades on decentralized exchanges.

How MEV Works

When you send a transaction on Ethereum, it normally goes to the mempool, a public waiting area for pending transactions. Anyone can read it. A pending swap shows which token is being bought, how much, and the worst price the trader will accept.

Specialized traders called searchers run bots that scan the mempool and simulate what each pending transaction will do. When a bot finds a profit opportunity, it builds its own transactions around the target and pays to have them placed in a specific position in the block.

The MEV Supply Chain

Most Ethereum blocks today are not assembled by the validator that proposes them. The work is split among several roles.

  • Searchers: find opportunities and submit bundles, which are groups of transactions that must be included together in a set order.
  • Builders: assemble full blocks from bundles and regular transactions, and bid for the right to have their block used.
  • Relays: pass blocks from builders to validators.
  • Validators: pick the highest bid and propose that block.

Validators connect to this market through MEV-Boost, open-source software developed by Flashbots and described in the Flashbots documentation. Competition among searchers and builders means a large part of MEV profit ends up with validators as higher block rewards. This arrangement is known as proposer-builder separation, and adding it to the Ethereum protocol itself is part of the roadmap.

Types of MEV

  • Arbitrage: a bot buys a token on one exchange where it is cheaper and sells on another where it costs more. This brings prices back in line and is generally viewed as harmless to other users.
  • Liquidations: bots compete to liquidate undercollateralized loans on lending protocols and collect the liquidation fee. Lending markets rely on this to stay solvent.
  • Front-running: a bot sees a pending transaction and places its own ahead of it to profit from the price change that follows.
  • Back-running: a bot places a transaction right after a large trade to capture the arbitrage it creates.
  • Sandwich attacks: a bot places one trade before the victim's swap and one after it.

Sandwich Attacks in Detail

Suppose a user swaps ETH for a token on a decentralized exchange and sets a slippage tolerance of 1 percent. That setting means the swap will still execute if the price is up to 1 percent worse than quoted.

A bot sees the pending swap. It buys the same token first, which pushes the price up. The user's swap then executes at the worse price, close to the slippage limit. The bot sells right after, at the price the user's purchase supported. All three transactions sit in the same block, in that order.

The user receives fewer tokens than expected, and the difference is the bot's profit, minus what it pays the builder and validator. Large trades in pools with thin liquidity and wide slippage settings are the easiest targets.

Why MEV Matters

  • Worse prices: sandwich attacks are a direct cost to traders.
  • Higher fees and failed transactions: before private bundles became common, bots fought with rising gas bids, which congested the network.
  • Centralization: a small number of builders produce most Ethereum blocks, which raises concerns about censorship and control.
  • Consensus risk: if the MEV in a block is large enough, it creates an incentive to reorganize the chain to capture it.

MEV is not unique to Ethereum. It exists on any chain where transaction order affects outcomes, including Solana, BNB Chain and Layer 2 networks, though the mechanics differ.

How to Reduce Your Exposure

  • Set slippage as low as is practical. Too low and the swap may fail, but a very high setting invites sandwiches.
  • Use a private transaction route. Services such as Flashbots Protect and MEV Blocker send transactions directly to builders, bypassing the public mempool. Some wallets offer this as a setting.
  • Split large trades into smaller ones, or trade in pools with deeper liquidity.
  • Consider exchanges that settle orders in batches at a single price, such as CoW Swap, which limits what reordering can achieve.
  • Be careful with tokens that require very high slippage to trade at all.

Common Mistakes

  • Leaving slippage on a high default for a large trade.
  • Assuming a small trade is always safe. Bots act whenever the profit exceeds their costs.
  • Confusing MEV with a hack. Sandwiching follows the rules of the protocol. It exploits public information, not a bug.
  • Expecting a single upgrade to end it. Proposed mitigations include encrypted mempools and protocol-level proposer-builder separation, but MEV is a structural feature of transparent blockchains.

Nothing in this article is financial advice.

Key Points

  • MEV comes from control over transaction ordering.
  • Searchers, builders and validators share the profit.
  • Arbitrage and liquidations are mostly neutral. Sandwich attacks cost traders directly.
  • Private transaction routes and tight slippage settings are the main defenses.

Track on CoinMarketGuy

The DEX page lists active liquidity pools with their volume and liquidity. Deeper pools mean less price impact for a given trade, which leaves less room for a sandwich. The Ethereum price page shows the live ETH price, market cap and chart.

#mev#ethereum#front-running#defi
📬

Enjoyed this article?

Get weekly crypto analysis, whale movements, and market insights delivered to your inbox.

Free. No spam. Unsubscribe anytime.

Track Crypto Like a Whale 🐋

Real-time prices, smart money tracking, and social sentiment — all free.

Open CoinMarketGuy →