Maximal Extractable Value (MEV) and Market Structure
This lesson covers a less visible but economically significant part of how Ethereum's transaction market actually works: Maximal Extractable Value, or MEV — extra value that can be captured by controlling the order and content of transactions within a block, beyond the standard priority fee covered in the gas and fees lesson.
What MEV actually is. A block proposer (or, in practice, the specialized "builders" and "searchers" who assemble and submit transaction bundles for proposers to include) has discretion over which pending transactions from the public mempool go into a block, and in what order. That discretion has value beyond the tips transactions voluntarily offer, because certain orderings or insertions can extract additional profit directly from the transactions themselves. This extra, structurally extractable value — on top of standard priority fees — is what "MEV" refers to. The name itself reflects the underlying economics precisely: it is the maximal value that can be extracted from a given set of pending transactions by whoever controls their ordering, not simply the value any one party happens to capture in practice.
Common sources of MEV. Two patterns account for much of documented MEV activity. Arbitrage between decentralized exchanges: if the same token trades at slightly different prices on two different exchanges at the same moment, a searcher can construct a bundle that buys low on one and sells high on the other within the same block, capturing the price difference risk-free (since both legs execute atomically or not at all). Sandwich attacks: when a trader submits a large pending swap with meaningful price slippage tolerance, a searcher can detect it in the public mempool before it's confirmed, insert their own buy order immediately before it (pushing the price up before the victim's trade executes) and a sell order immediately after (capturing the price moved by the victim's own trade) — extracting value directly from the victim's slippage tolerance. A third, less common pattern is liquidation MEV: in the overcollateralized lending protocols covered in Module 5, being the first to submit a liquidation transaction when a borrower's collateral falls below the required threshold often earns a liquidation bonus, which creates its own competitive, MEV-like race among searchers watching for eligible positions.
Why arbitrage MEV is generally viewed differently from sandwich MEV. It's worth distinguishing these two common sources, since they are not equally harmful. Cross-exchange arbitrage tends to improve overall market efficiency — it pushes prices on different exchanges back toward alignment, which benefits the broader market even though the searcher profits from doing it. A sandwich attack, by contrast, extracts value directly and specifically from one identifiable victim's trade, with no corresponding benefit to the broader market. This distinction matters when evaluating MEV as a phenomenon: not all of it is predatory, even though the term often carries a negative connotation drawn mainly from the sandwich-attack case.
Why Proposer-Builder Separation emerged. Left unaddressed, MEV extraction tended to concentrate among whichever validators had the most sophisticated infrastructure for detecting and capturing it, and happened somewhat opaquely. Proposer-Builder Separation (PBS) is infrastructure that separates the role of building a block's exact transaction content (done by specialized builders, competing with each other) from the role of simply proposing whichever fully built block offers the best payment (done by validators, who don't need their own sophisticated MEV infrastructure to participate fairly). This makes MEV extraction more transparent and competitive — builders compete openly for the right to have their block proposed, rather than extraction happening invisibly inside whichever individual validator happens to be selected. A validator using this infrastructure typically just selects the highest-paying block offered by competing builders, receiving that payment as additional income on top of the standard issuance and priority fee rewards covered in the previous lesson.
Why this matters for an ordinary user. MEV isn't an abstract, validator-only concern — sandwich attacks in particular extract value directly from ordinary users' trades. Understanding that pending transactions are visible in the public mempool before confirmation, and that high slippage tolerance widens the window a sandwich attacker can exploit, is directly actionable: it's the reasoning behind practical advice (covered further in Module 4) to set tight slippage tolerances and, for sensitive trades, consider private transaction relays that don't expose pending trades to the public mempool before inclusion.
Worked Example
A documented sandwich-attack pattern works as follows: a trader submits a swap with a 3% slippage tolerance (meaning they'll accept up to a 3% worse price than the quoted rate). A bot monitoring the public mempool detects this pending transaction, submits its own buy order with a higher gas tip to ensure it's included in the same block immediately before the victim's trade (pushing the price up), lets the victim's trade execute at the now-worse price, and then immediately sells in a third transaction in the same block, capturing the difference. The entire attack exploits two things: the pending transaction's visibility in the public mempool, and the victim's own slippage tolerance, which defines exactly how much room the attacker has to extract.
Exercise
Write two or three sentences on why a large swap with high slippage tolerance set in a wallet might be more exposed to MEV, and one practical step a user could take to reduce that exposure (for example, tightening slippage tolerance or using a private transaction relay).
Recap
- MEV is extra value a block proposer, builder, or searcher can extract by controlling transaction order and content within a block, beyond standard priority fees.
- Common sources include cross-exchange arbitrage (which tends to improve market efficiency), sandwich attacks (which extract value directly from a specific victim), and liquidation races in lending protocols.
- Proposer-Builder Separation (PBS) emerged to make MEV extraction more transparent and competitive, rather than hidden inside whichever validator happens to be selected.
Resources
- Ethereum.org: MEV — official documentation on MEV sources and Proposer-Builder Separation.
- Flashbots — research and infrastructure for transparent, competitive MEV extraction and private transaction relays.
- MEV-Explore (Flashbots) — a public dashboard tracking historical MEV activity on Ethereum.