Advanced · Market structure

What is MEV? Front-running and sandwich attacks explained

How a sandwich attack worksYou send a swap. A bot spots it in the public mempool. The bot buys first and the price rises. You buy higher, then the bot sells.1You send a swap2A bot spots it in the publicmempool3The bot buys first and the pricerises4You buy higher, then the bot sells
How a sandwich attack works

The short lesson

Pending transactions often wait in a public mempool. Anyone can see them. Bots scan for trades they can profit from.

  • Front-running: a bot copies your trade and gets in first.
  • Sandwich attack: a bot buys just before your swap and sells just after, so you get a worse price.
  • Arbitrage and liquidations are also MEV. Some of it keeps prices in line across markets.

How users reduce it

  • Set a tight slippage limit so a sandwich cannot push your price far.
  • Use a wallet or service that sends transactions privately.
  • Split very large swaps, or use apps that batch orders.
  • Big trades in small pools are the easiest targets.

Lesson game · earn XP

Check yourself: 3 quick questions

Perfect score = combo bonus. Each question returns in your spaced-repetition review.

Memory · spaced repetition

Flashcards: lock it in

Flip each card, then say if you knew it. Missed cards come back sooner.

Keep learning

Common questions

Is MEV illegal?

It sits in a gray area and depends on the facts and the country. Some forms look like market abuse. This lesson only explains how it works.

Does MEV happen on every chain?

Any chain where transaction order can be chosen has some MEV. The details differ by chain.

Sources

  1. ethereum.org: Maximal extractable value (MEV)
  2. Flashbots docs: Flashbots Protect
  3. ethereum.org: Ethereum security and scam prevention

Sources checked October 31, 2026. Rules change; check the official source before acting.

Education only. Not investment, tax or legal advice. We do not pick coins.