Every time you submit a transaction to a blockchain, you are entering a competitive market that most users never see. Before your transaction is confirmed, it sits in a public waiting area called the mempool, visible to anyone watching. Sophisticated actors scan this mempool continuously, looking for profitable opportunities created by the ordering of pending transactions. The profit they extract is called Maximal Extractable Value (MEV).
MEV was originally termed Miner Extractable Value when Ethereum used Proof of Work, since miners controlled transaction ordering within blocks. After Ethereum's transition to Proof of Stake in September 2022, the term was updated to "Maximal Extractable Value" to reflect that validators (not miners) now propose blocks. The concept remains identical: whoever controls transaction ordering within a block can extract value by strategically including, excluding, or reordering transactions.
How MEV Extraction Works
The MEV supply chain involves several specialized actors:
- Users submit transactions to the public mempool (or private channels).
- Searchers monitor the mempool using custom bots. They identify MEV opportunities and construct transaction bundles designed to capture that value.
- Builders aggregate transaction bundles from multiple searchers and construct complete blocks optimized for MEV extraction.
- Proposers (validators) select the most profitable block from competing builders and propose it to the network.
This separation of roles is formalized in Ethereum's current architecture through Proposer-Builder Separation (PBS), implemented via the MEV-Boost middleware developed by Flashbots.
Types of MEV
Arbitrage
The most common and arguably the most benign form of MEV. When the same asset trades at different prices across two or more DEX pools, a searcher can buy on the cheaper venue and sell on the more expensive one in a single atomic transaction, pocketing the difference. This activity generally benefits the market by aligning prices across venues, improving price efficiency for all participants.
Example: ETH trades at $2,000 on Uniswap and $2,005 on SushiSwap. A searcher buys on Uniswap and sells on SushiSwap, profiting $5 per ETH minus gas costs. After the arbitrage, both pools reflect a more accurate price.
Liquidations
Lending protocols like Aave and Compound allow anyone to liquidate undercollateralized positions, earning a liquidation bonus (typically 5-10% of the collateral). Searchers compete aggressively to be the first to liquidate eligible positions, often paying substantial gas fees or priority fees to ensure their liquidation transaction is included before competitors.
Liquidation MEV is generally considered beneficial to the DeFi ecosystem because it maintains protocol solvency. Without liquidators, bad debt would accumulate and threaten systemic stability.
Sandwich Attacks
This is the form of MEV most harmful to ordinary users. A sandwich attack occurs when a searcher detects a large pending swap in the mempool and places two transactions around it:
- Front-run: The searcher buys the same asset before the victim's trade, pushing the price up.
- Victim trade: The user's swap executes at a worse price than expected.
- Back-run: The searcher sells immediately after the victim's trade, capturing the price difference as profit.
The victim receives fewer tokens than they would have without the attack. The searcher's profit comes directly from the user's increased slippage. Sandwich attacks are estimated to cost DeFi users hundreds of millions of dollars annually.
Just-In-Time (JIT) Liquidity
In concentrated liquidity DEXes like Uniswap v3, a JIT liquidity provider detects a large pending swap, adds a highly concentrated liquidity position around the current price just before the swap, earns fees from the swap, and removes the liquidity immediately after. This captures fee revenue that would have gone to passive liquidity providers. While not directly harmful to the swapper, it extracts value from existing LPs.
The Flashbots Ecosystem
Flashbots is a research and development organization that has become the de facto infrastructure layer for MEV on Ethereum. Its core contributions include:
MEV-Boost
MEV-Boost is middleware that implements Proposer-Builder Separation (PBS) for Ethereum validators. Instead of validators building their own blocks, MEV-Boost allows them to outsource block construction to specialized builders who compete to produce the most profitable block. The validator simply selects the highest-bidding block and proposes it.
As of early 2025, the vast majority of Ethereum blocks are produced through MEV-Boost. This represents a significant centralization concern: a small number of builders produce a disproportionate share of blocks.
Flashbots Protect
Flashbots Protect is an RPC endpoint that users can add to their wallet (e.g., MetaMask). Transactions submitted through Flashbots Protect bypass the public mempool entirely, going directly to block builders. This prevents sandwich attacks and other front-running strategies because searchers cannot see the transaction before it is included in a block.
SUAVE (Single Unified Auction for Value Expression)
SUAVE is Flashbots' next-generation vision for MEV infrastructure: a decentralized, chain-agnostic platform for transaction ordering and block building. It aims to address the centralization concerns of the current builder market by creating an open, programmable marketplace for block construction.
Proposer-Builder Separation (PBS)
PBS is the architectural principle that separates the roles of block proposing (selecting which block to add to the chain) from block building (determining which transactions to include and in what order). This separation exists because:
- Without PBS: Validators who are also sophisticated MEV extractors have an advantage over validators who are not. This creates centralization pressure as staking becomes more profitable for technically sophisticated operators.
- With PBS: All validators can access the same MEV revenue by outsourcing block construction to specialized builders. The MEV is still extracted, but the revenue is distributed more equitably across validators.
PBS is currently implemented "out of protocol" via MEV-Boost. Ethereum's roadmap includes enshrined PBS (ePBS), which would encode this separation directly into the Ethereum protocol, reducing reliance on trusted relay infrastructure.
| MEV Type | Who Profits | Who Loses | Net Effect on Market |
|---|---|---|---|
| DEX Arbitrage | Searcher | LPs (indirect) | Positive (price alignment) |
| Liquidations | Searcher | Borrower | Positive (protocol solvency) |
| Sandwich Attacks | Searcher | User (direct) | Negative (user harm) |
| JIT Liquidity | Searcher | Passive LPs | Neutral to negative |
MEV's Impact on Users
For ordinary DeFi users, MEV manifests in several tangible ways:
- Increased slippage: Sandwich attacks cause users to receive fewer tokens than expected on swaps.
- Failed transactions: During high-MEV periods, gas prices spike as searchers compete. Users who do not pay competitive gas fees see their transactions stuck or reverted.
- Invisible costs: MEV is a hidden tax on DeFi usage. Users rarely realize they have been sandwiched because the transaction still succeeds, just at a worse price.
- Priority fee escalation: Searcher competition drives up priority fees, raising costs for all network users.
MEV Protection Strategies
- Private mempools: Use Flashbots Protect or MEV Blocker to send transactions directly to builders, bypassing the public mempool.
- MEV-aware DEXes: Platforms like CoW Swap use batch auctions instead of AMMs, eliminating front-running by design. 1inch Fusion routes trades through resolvers who compete to offer the best execution.
- Low slippage tolerance: Setting tight slippage limits (e.g., 0.5%) makes sandwich attacks unprofitable because the attacker cannot move the price enough to extract value without causing the victim's transaction to revert.
- Smaller trade sizes: Larger trades attract more MEV attention. Splitting large trades across multiple smaller transactions reduces the incentive for searchers.
- Limit orders: Using limit orders instead of market swaps eliminates slippage entirely, though at the cost of execution certainty.
Ethical Considerations
MEV raises fundamental questions about fairness in decentralized systems:
Is MEV inherently exploitative? Some forms of MEV (arbitrage, liquidations) serve essential market functions. Others (sandwich attacks) extract value from users with no compensating benefit. The DeFi community has not reached consensus on where to draw the line.
Centralization risk: The MEV supply chain is highly concentrated. A small number of builders and relays process the majority of Ethereum's blocks. This concentration creates censorship vectors and single points of failure that undermine Ethereum's decentralization goals.
MEV redistribution: Some protocols are exploring mechanisms to return captured MEV to users or LPs. Protocols like MEV Blocker (by CoW DAO) auction off the right to back-run transactions and return a portion of the proceeds to users. This represents a philosophical shift from eliminating MEV to redistributing it.
Key Takeaways
- MEV is the profit extracted from strategic transaction ordering within blocks. It is a structural feature of permissionless blockchains, not a bug.
- Sandwich attacks are the most harmful MEV type for users. Arbitrage and liquidation MEV serve useful market functions.
- Flashbots and MEV-Boost have formalized the MEV supply chain through Proposer-Builder Separation, but have also introduced centralization concerns.
- Users can protect themselves using private mempools (Flashbots Protect), MEV-aware DEXes (CoW Swap), and tight slippage settings.
- MEV is estimated in the billions of dollars cumulatively. It is a hidden but significant cost of using DeFi that every participant should understand.