- MEV stands for “Miner Extractable Value” or “Maximal Extractable Value.”
- It refers to the extraction of value from Ethereum users by reordering, inserting, and censoring transactions within blocks.
- MEV is one of Ethereum’s biggest issues, with more than $689 million extracted from users of the network year-to-date.
Share this article
By leveraging their discretionary power to sequence transactions within blocks, miners can extract value from decentralized application users on Ethereum, greatly diminishing the user experience and threatening the stability of the network.
MEV, The Invisible Tax On Ethereum Users
MEV is an abbreviation of “Miner Extractable Value” or “Maximal Extractable Value.” It refers to profits that can be made by extracting value from Ethereum users by reordering, inserting or censoring transactions within blocks being produced. It typically affects DeFi users interacting with automated market makers and other apps.
Interestingly, the problem of MEV in Ethereum was first identified in 2014—a year before Ethereum launched—by an analyst coder and long-time algorithmic trader operating under the pseudonym Pmcgoohan.
Horrified by what happened in 2008 and the outfall of the global financial crisis, when Pmcgoohan first heard about Ethereum and the idea of a programmable blockchain promising distributed and equitable markets, he became enamored. To use his own words, it “blew his mind,” and he was “so excited about it,” but when he looked at Ethereum’s pre-Genesis draft documents, he was taken aback to find a critical flaw. Pcgoohan recognized that miners had total control of the transaction inclusion and ordering process, which meant that they could leverage this power to extract value from unsuspecting users of the protocol went it went live.
While some instantly recognized the shortfalls of Ethereum’s proposed design, Pmcgoohan was, unfortunately, ahead of his time, and his warning fell largely on deaf ears. That is until, in 2019, a group of researchers highlighted the issue by publishing a paper called Flash Boys 2.0, where the “MEV” term was first coined to describe the problem Pmcgoohan had referenced years earlier.
Subsequently, Georgios Konstantopoulos’ and Dan Robinson’s Ethereum is a Dark Forest, and Samczsun’s Escaping the Dark Forest articles, published in Aug. and Sep. 2020 respectively, cemented MEV as a fundamental concept in crypto-economics and highlighted its importance as one of the most challenging and pressing issues the Ethereum research community faces today.
These texts revealed that MEV was not merely a theoretical issue, but a real phenomenon already occurring at a significant scale with concerning consequences for Ethereum users.
Why MEV Occurs
In Ethereum, miners are responsible for selecting and aggregating transactions into blocks. Crucially, they have full autonomy in deciding which transactions from the mempool—an off-chain space where pending transactions await confirmation—they’ll include in the blocks they mine.
As miners, validators, and sequencers optimize for profit, they tend to select and order transactions by the highest gas price or transaction fees. However, the protocol does not require transactions to be ordered according to fees. Miners can leverage their discretionary ability to reorder transactions to extract additional profits from users. This “irregular” stream of revenue is MEV.
Although MEV is most frequently associated with miners, it is neither a Proof-of-Work nor an Ethereum-exclusive issue. Moreover, “miner extractable value” is a somewhat misleading term. In reality, the majority of MEV extraction today comes from so-called “searchers”—usually arbitrage traders and bot operators—actively seeking and identifying MEV opportunities on-chain and capturing them in different ways, whereas miners only indirectly profit from these traders’ transaction fees. MEV exists on all smart contract-enabled blockchains with a party responsible for transaction ordering, including validators in Proof-of-Stake-based systems like Ethereum 2.0 and rollup providers on Optimistic Rollups.
Understanding the MEV Game
The best way to understand the MEV game is to look at it through the lens of the key players, including miners, searchers, users, decentralized applications, and protocol developers.
The miners or block producers are responsible for sequencing transactions and deciding which transactions to include in blocks and in what order. Miners can profit from the MEV game in two ways: first, by selling scarce block space to non-miner MEV extractors through so-called Priority Gas Auctions (PGA) in exchange for exorbitant transaction fees, and by capturing MEV directly through reordering, including, or censoring transactions to profit from on-chain liquidation or arbitrage opportunities for themselves.
MEV also involves the end-users, such as people taking out on-chain loans or trading on decentralized exchanges. Users are the most exploited party in this game as they emit some amount of value that can be captured by miners and non-miner MEV extractors.
Decentralized applications and protocol developers play an auxiliary role. The former create MEV opportunities through their design and the incentives they produce, while the latter establishes the game’s base rules such as giving block producers power to sequence transactions, which is what makes MEV possible.
Finally, central to the MEV game are the searchers or the DeFi traders and bot operators who seek to identify MEV opportunities and capture them in different ways. The two primary ways searchers participate in the MEV game are by bidding exorbitant gas prices in on-chain PGAs to have their transactions strategically placed at specific positions within blocks by miners, and by expressing transaction ordering preferences to miners off-chain using novel MEV extraction tools like Flashbots.
The Searchers’ Typical MEV Extraction Process
Searchers start their MEV journey by monitoring the Ethereum blockchain using bots and automation tools for potential profit extraction opportunities.
When they spot an opportunity, searchers analyze the logic behind the trade, conceptualize the attack vector, and create a bundle—one or more transactions grouped and executed in the order they’re provided—designed to materialize its MEV extraction goal when mined. Searchers’ transaction bundles can refer to other users’ pending transactions in the mempool and target specific blocks for inclusion.
Once a bundle is created, a searcher will usually send it to a miner using off-chain networks like Flashbots’ MEV-Geth. This allows them to avoid the public transaction pool and express their transaction ordering preferences fast and risk-free (they save on gas fees when their transactions are rejected) directly to miners.
As searchers in aggregate submit a huge amount of bundles and block space is limited, miners auction their block space through a Flashbots Auction—an off-chain first-price sealed-bid auction where searchers can privately communicate their bid and granular transaction order preference directly to miners without paying for failed bids—and only include the most profitable transactions in their block.
When a miner includes a searcher’s bundle or a transaction in their block, the MEV extraction process is complete. The searcher’s transaction gets confirmed on-chain and, if the MEV strategy was well-designed, the searcher would have extracted some amount of value from other traders on Ethereum.
The Most Common Attacks
Front-running involves getting a transaction first in line in the execution queue ahead of a known pending transaction. In Ethereum, searchers run specialized front-running bots that scan the network for large orders on decentralized exchanges and submit competing transactions with higher gas fees to get them mined before the victim’s transaction.
A sandwich attack is a variation of front-running whereby a predatory trader places two transactions, one before and another right after a pending victim transaction. Searchers typically use sandwich attacks to extract MEV from unsuspecting traders on decentralized exchanges by manipulating the price of an asset. For example, a trader can identify a token a victim is about to buy and make a trade to push the price up, then sell the token straight after the victim’s buy order has further increased the price.
Back-running is the practice of getting a transaction ordered second in line or immediately after a known pending target transaction. Searchers typically employ back-running bots to monitor the mempool for new token pair listings or liquidity pools created on decentralized exchanges like Uniswap. When a bot finds a new token pair listing, it can place a transaction order immediately after the initial liquidity and buys as many tokens as possible, leaving only a small amount for other traders to buy later. The bot can then wait for the price to go up after other traders have purchased the tokens and sell at a higher price for a profit.
Liquidators are searchers that specialize in extracting MEV through liquidations of over-collateralized loans on decentralized on-chain protocols like Compound, Maker, Aave, and dYdX. Liquidators run specialized bots to monitor the network for transactions presenting liquidation opportunities and act to either front-run or back-run transactions to be the first to liquidate a loan. Liquidators extract MEV from unsuspecting borrowers by liquidating their loans before they can repay the debt, then profit by selling the borrowers’ collateral.
Time-bandit attacks are a novel type of attack only miners can execute that retroactively reorganize blocks to capture MEV opportunities in previously mined blocks. When MEV is…
Read More:What Is MEV? Ethereum’s Invisible Tax Explained