Level 4 · Money and marketsThe gold rush#289

MEV explained: whoever orders the queue gets paid, and sometimes by you

MEV is the extra profit available to whoever decides which transactions go into a block and in what order. For a DEX user it shows up as front-running and sandwich attacks; a tight slippage tolerance and a private transaction route are the two practical defences.

Picture the queue at the boomtown assay office. Everyone waits with a bag of dust and a slip saying what they want. The clerk decides who goes first.

Now imagine the clerk can read every slip, and takes tips to change the order. A man who sees you are about to sell a big sack can push in front of you, sell first, and buy back cheap behind you.

That clerk is a block producer, the tip is MEV, and the man pushing in is a bot. Nobody broke a lock. They just read the queue.

What it is

MEV stands for maximal extractable value. Ethereum's own documentation defines it as "the maximum value that can be extracted from block production" beyond the normal block reward and gas fees, by including, excluding or reordering transactions (ethereum.org, MEV).

Some MEV is harmless or even useful, such as arbitrage that pulls a DEX price back in line with other markets. The part that hurts users is front-running: someone sees your pending trade and places theirs first.

Its best-known form is the sandwich. In ethereum.org's description, a searcher watching the public mempool can "execute an optimal buy order immediately before the large trade" and a sell order immediately after it.

How it works

Take the pool from "Slippage explained": 1,000 ether and 2,000,000 USDC, a 0.30% fee like Uniswap v2 (Uniswap Developers, Fees). The pool is an assumption for the arithmetic. At the assumed ether price of 2,000 dollars, the screen shows 2,000 USDC per ether.

You send a swap of 10,000 USDC for ether. The quote is 4.9603 ether. You set a slippage tolerance of 1%, so your minimum is 4.9107 ether.

A bot sees your swap in the mempool and builds a sandwich:

  • Bread, top: the bot swaps 10,000 USDC into the pool first and gets 4.9603 ether. The price of ether in the pool goes up.
  • Filling: your swap runs at the worse price. You get 4.9112 ether. That is above your minimum, so it goes through.
  • Bread, bottom: the bot sells its 4.9603 ether back and gets 10,039.15 USDC.

The bot made 39.15 USDC before its gas and whatever it tipped the block builder. You received about 0.049 ether less than quoted, about 98 dollars at the assumed price. The difference between your loss and the bot's gain went into pool fees and the moved price.

Now the same attack with your tolerance at 0.5%. Your minimum would have been 4.9355 ether. After the bot's top slice you would only get 4.9112, so your swap would revert. A sandwich that makes the filling fail makes no money from you. The tolerance is the size of the plate.

Why it matters

Every loose tolerance is an invitation. It tells the bots exactly how far they can push the price before your trade fails.

MEV also shows how hard the line between clever and criminal is to draw. In May 2024, the US Justice Department charged two brothers, Anton and James Peraire-Bueno, with wire fraud and money laundering over a scheme it said took about $25 million "within approximately 12 seconds" from trading bots on Ethereum (DOJ, 15 May 2024).

The case did not end with a conviction. A first trial ended in a mistrial in November 2025. On 16 November 2026, Judge Jessica Clarke of the Southern District of New York granted the brothers' motion for a judgment of acquittal on all three counts, finding the evidence insufficient (court order of 16 November 2026, via Decrypt). The sheriff arrived, and the court found the evidence too thin.

Where people get it wrong

  • "MEV is a hack." Mostly it isn't. It uses public information and the normal rules of block building. That is why it is hard to stop.
  • "Only whales get sandwiched." Any swap worth more to a bot than its gas can be a target. Small, tight trades are less attractive, not immune.
  • "A failed swap means the bot won." Usually the opposite: your tolerance did its job. You lost the gas, not the trade.
  • "The court case made sandwiches illegal, or legal." It decided one criminal case on its facts. It is not a rulebook for MEV.

Hide the slip, shrink the plate

Two checks before a large swap. First, set your slippage tolerance as low as the trade allows. Second, find out whether your wallet or app can send the transaction through a private route instead of the public mempool.

Flashbots Protect is one such route: transactions go "to a private Flashbots mempool where they will be hidden from frontrunning and sandwich bots" (Flashbots Docs). It is an example, not a recommendation; some wallets and aggregators offer their own versions.

The bot can't jump a queue it can't see.

Frequently asked questions

What is MEV in crypto?

MEV, or maximal extractable value, is the extra profit a block producer or a bot working with one can make by choosing which transactions go into a block and in what order. It includes arbitrage, liquidations and front-running of users' trades.

What is a sandwich attack?

A bot sees your pending DEX swap, buys the same token just before you, lets your swap run at the higher price, and sells straight after. The bot's profit comes from the worse price you received, up to the limit set by your slippage tolerance.

How can I protect myself from MEV?

Use a tight slippage tolerance so a sandwich would make your swap fail, and send large swaps through a private transaction route instead of the public mempool. Splitting a very large trade or using deeper pools also reduces how much a bot can take.

Is MEV illegal?

Ordinary MEV such as arbitrage is not treated as a crime. In the Peraire-Bueno case, US prosecutors charged an alleged attack on trading bots as wire fraud, but on 16 November 2026 a federal judge acquitted both brothers for insufficient evidence.

Who earns MEV?

The searchers who find the opportunity, the builders who assemble blocks, and the validators who propose them all share in it, through tips and bids. Users pay for the harmful part through worse prices on their trades.

Sources

  1. ethereum.org, Maximal extractable value (MEV)
  2. US Department of Justice, Two brothers arrested for attacking Ethereum blockchain and stealing $25M in cryptocurrency (15 May 2024)
  3. US District Court, S.D.N.Y., United States v. Peraire-Bueno, 24-CR-293 (JGLC), opinion and order of 16 November 2026 (via Decrypt)
  4. Flashbots Docs, Flashbots Protect overview
  5. Uniswap Developers, Fees (v2 flat 0.30% fee)

Read next.