What Is MEV? Front-running, Sandwiches and Block Building
Maximal Extractable Value (MEV) is the profit extracted by reordering blockchain transactions. Understand how searchers, builders, and proposers operate in the modern crypto ecosystem.
Key points
- MEV is the profit extracted by network operators through the reordering, inclusion, or exclusion of transactions within a block.
- The MEV supply chain is divided into searchers (who find opportunities), builders (who construct blocks), and proposers (who validate blocks).
- Arbitrage and liquidations are beneficial forms of MEV, while sandwich attacks act as a hidden tax on users.
- Proposer-Builder Separation (PBS) prevents network centralization by allowing any validator to access MEV profits without running complex algorithms.
- Users can protect themselves from predatory MEV by using private RPC endpoints and strictly managing slippage tolerances.
Maximal Extractable Value (MEV) is the maximum profit that network operators can extract by adding, removing, or reordering transactions within a blockchain block. It functions as an invisible economic layer beneath decentralized finance, where specialized actors compete to capture value from user activity.
Originally termed "Miner Extractable Value" during the era when proof-of-work miners controlled block production, the concept was renamed to "Maximal Extractable Value" following the transition of major networks to proof-of-stake. Regardless of the consensus mechanism, the fundamental principle remains the same: whoever dictates the order of transactions in a block has the power to profit from that sequence.
The Anatomy of a Transaction
To understand MEV, one must first understand how a transaction is processed on a public blockchain. When a user submits a transaction—such as swapping tokens on a decentralized exchange or transferring funds—it does not immediately finalize on the ledger. Instead, it is broadcast to a network of nodes and enters a waiting area known as the mempool (memory pool).
The mempool is a public, transparent queue of unconfirmed transactions. Network operators, such as validators or miners, select transactions from this pool to construct the next block. Historically, operators simply ordered transactions based on the transaction fee attached to them, prioritizing those that paid the highest fee per unit of computational effort.
However, because the mempool is public, anyone can monitor pending transactions. Observers quickly realized that the specific order of transactions within a block could significantly impact market prices on decentralized exchanges. By strategically inserting their own transactions before, after, or between pending user transactions, these observers could guarantee a profit. This realization birthed the MEV ecosystem.
How MEV Works: The Supply Chain
The extraction of MEV has evolved from a simple operation into a highly specialized, multi-billion-dollar supply chain. This ecosystem is primarily divided into three distinct roles: searchers, builders, and proposers.
Searchers are the analysts of the MEV world. They run complex algorithms and automated bots that constantly scan the mempool and the current state of the blockchain for profitable opportunities. When a searcher finds an opportunity, they do not just submit a single transaction; they create a "bundle." A bundle is a specific sequence of transactions—often combining the searcher's own trades with pending user transactions—designed to execute in a precise order. Searchers attach a fee to these bundles to incentivize their inclusion in a block.
Block builders receive these bundles from multiple competing searchers. The builder's job is to aggregate these bundles, along with standard user transactions from the mempool, to construct the most profitable block possible. Builders compete against one another to create the block with the highest total value.
Proposers are the network validators selected by the protocol to propose the next block to the blockchain. Instead of building the block themselves, proposers simply evaluate the fully constructed blocks offered by the builders and select the one that pays them the highest fee.
Common MEV Strategies
Searchers employ various strategies to extract value. Some of these strategies are beneficial to the network, while others act as a hidden tax on everyday users.
Arbitrage is the most common and generally accepted form of MEV. Decentralized exchanges rely on smart contracts to price assets based on supply and demand within individual liquidity pools. Consequently, the price of an asset like $ETH might briefly differ between two separate exchanges. A searcher will spot this discrepancy, buy the asset on the cheaper exchange, and instantly sell it on the more expensive one within the same transaction bundle. This extracts profit for the searcher while simultaneously realigning the prices across the market, ensuring market efficiency.
Liquidations are another structural form of MEV. Decentralized lending protocols require borrowers to overcollateralize their loans. If the value of the collateral falls below a certain threshold, the protocol allows anyone to liquidate the collateral to repay the debt, offering a discount or fee as a reward. Searchers monitor price feeds and race to be the first to execute these liquidations. While highly competitive, this process is necessary to protect lending protocols from insolvency.
Conversely, a sandwich attack is a predatory MEV strategy that directly harms users. It occurs when a searcher exploits a user's pending trade by manipulating the price of an asset immediately before and after the user's transaction executes.
Consider a worked numeric example of a sandwich attack. Assume a user submits a trade to swap 10,000 $USDC for $ETH on a decentralized exchange. The user sets a slippage tolerance of 1%, meaning they are willing to accept a price up to 1% worse than the current quote to ensure the trade executes.
A searcher's bot spots this pending transaction in the mempool. The bot calculates that buying 50 ETH from the same liquidity pool will push the price of ETH up by exactly 0.99%. The searcher constructs a bundle with three steps:
- Front-run: The searcher buys 50 ETH, pushing the price up by 0.99%.
- User Trade: The user's 10,000 USDC trade executes at this artificially inflated price, yielding less ETH than they originally anticipated but still within their 1% slippage limit. This trade pushes the price of ETH up even further.
- Back-run: The searcher immediately sells the 50 ETH at the new, higher price.
The searcher pockets the price difference, minus network fees, while the user suffers a worse execution price. The exact profitability of MEV strategies fluctuates constantly based on market volatility and block space demand.
The Impact of MEV
The existence of MEV presents a complex dilemma for blockchain networks. On one hand, MEV is a fundamental economic driver. Arbitrage and liquidations are critical maintenance functions that keep decentralized markets solvent and accurately priced. Without financial incentives for searchers to perform these actions, decentralized finance could not function efficiently.
On the other hand, predatory MEV like sandwich attacks and front-running degrades the user experience. It acts as an invisible tax on traders, increasing the cost of interacting with decentralized applications. Furthermore, the competition to extract MEV can lead to network congestion. In the past, searchers engaged in "Priority Gas Auctions," repeatedly bidding up transaction fees to ensure their bundles were executed first, which artificially inflated fees for all users on the network.
Proposer-Builder Separation (PBS)
As MEV extraction became more lucrative, it introduced a severe centralization risk to blockchain networks. If validators were required to run their own complex searcher algorithms to remain profitable, only large, well-funded institutions could afford to operate nodes. This would centralize network control in the hands of a few sophisticated actors.
To mitigate this risk, the Ethereum ecosystem pioneered Proposer-Builder Separation (PBS). PBS formally divides the roles of block building and block proposing. By outsourcing the complex, resource-intensive task of block construction to specialized builders, PBS allows any validator—regardless of their technical sophistication or hardware capabilities—to earn a share of MEV profits simply by proposing the most lucrative block offered to them.
Currently, PBS is implemented via external software relays, such as MEV-Boost. These relays act as trusted intermediaries between builders and proposers, ensuring that builders cannot steal MEV opportunities and proposers cannot alter the blocks they agree to propose. The specific implementation details of Proposer-Builder Separation are subject to ongoing research and protocol upgrades, with long-term goals of baking PBS directly into the core protocol to remove the reliance on trusted relays.
Protecting Users from Malicious MEV
As the MEV landscape matures, developers have introduced tools to protect everyday users from predatory extraction.
One primary defense is the use of private RPC (Remote Procedure Call) endpoints. Instead of broadcasting a transaction to the public mempool where searchers can exploit it, users can route their transactions through private channels. These services send transactions directly to block builders with strict conditions that they cannot be front-run or sandwiched. Some of these services even offer "MEV-Share" or order flow auctions, where builders bid for the right to execute the user's transaction, and a portion of the extracted MEV is refunded to the user.
Additionally, users can protect themselves by strictly managing their slippage tolerance on decentralized exchanges. Setting a low slippage tolerance (e.g., 0.1%) limits the profit margin available to a searcher attempting a sandwich attack, often making the attack unprofitable once network fees are factored in. However, setting slippage too low in a volatile market can result in the transaction failing entirely.
Finally, the industry is seeing a shift toward intent-based architectures. Instead of defining the exact execution path of a trade, users broadcast an "intent" (e.g., "I want to swap 10,000 USDC for at least 4.5 ETH"). Specialized solvers then compete to find the best execution route to fulfill that intent, absorbing the MEV risk on behalf of the user.
Common Misconceptions
- MEV is entirely malicious: While sandwich attacks harm users, arbitrage and liquidations are essential for the health of decentralized markets. MEV is a neutral economic force that can be harnessed for both constructive and extractive purposes.
- MEV only exists on Ethereum: MEV exists on any blockchain where transaction ordering impacts financial outcomes. While the mechanics differ, networks like Solana, Binance Smart Chain, and even Bitcoin experience forms of MEV.
- Validators keep all MEV profits: Under the PBS model, builders must bid against each other to have their blocks proposed. This competition forces builders to pass the vast majority of extracted MEV value to the proposers (validators) to ensure their block is selected.
How This Connects to the Market
MEV is no longer a niche technical quirk; it is a foundational pillar of crypto market structure. The flow of MEV dictates the profitability of staking yields, influences the design of new decentralized exchanges, and drives the development of blockchain scaling solutions.
For institutional investors and sophisticated traders, understanding MEV is critical for achieving optimal trade execution and managing slippage costs. For protocol developers, mitigating the centralizing forces of MEV remains one of the most pressing challenges in blockchain architecture. As networks scale and transaction volumes grow, the mechanisms for extracting, distributing, and protecting against MEV will continue to shape the economic reality of the digital asset ecosystem.
Questions this story raises
- What does MEV stand for?
- MEV originally stood for Miner Extractable Value. Following the transition of major networks to proof-of-stake, it is now commonly referred to as Maximal Extractable Value.
- How does a sandwich attack work?
- A searcher spots a user's pending trade and places a buy order immediately before it to drive the price up. The user's trade executes at the worse price, pushing it higher, after which the searcher immediately sells for a profit.
- Is MEV illegal?
- MEV is a technical reality of public blockchains. While regulators have scrutinized certain predatory practices like front-running in traditional finance, the legal status of specific MEV strategies in decentralized finance remains an evolving area of regulatory focus.
- How can I avoid MEV?
- Users can mitigate MEV risks by setting low slippage tolerances on decentralized exchanges or by routing their transactions through private RPC endpoints that protect against front-running.
References
- [1] Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges — arXiv
- [2] Flashbots Documentation — Flashbots
- [3] Maximal extractable value (MEV) — Ethereum Foundation
- [4] Proposer-builder separation (PBS) — Ethereum Foundation
Evergreen explainer written by Basis Desk's system and checked by an independent model pass for factual errors and advice language. Figures, fees and rules change — the references above are where to verify current specifics. Market figures marked "at the time of writing" come from live exchange data. Report an error: corrections@basisdesk.news · corrections policy.
The Daily Brief, in your inbox at 07:00 ET
Five stories, the numbers that moved, what to watch. Three minutes. No hype, no advice, unsubscribe in one click.
Get the big crypto stories first
A few alerts a day at most: major breaking news and the morning brief. Switch off anytime.
Not financial advice. Basis Desk publishes information, not recommendations. Crypto assets are volatile and you can lose what you invest.