Telegram (AI) YouTube Facebook X
Ру

What is MEV in Ethereum

What is MEV in Ethereum
Advanced
What is MEV in Ethereum
Advanced

Key points

  • Maximal Extractable Value (MEV) is the extra profit miners or validators can earn by reordering transactions before a new block is confirmed.
  • MEV raises network fees by imposing additional costs on users, often around transactions in decentralised applications. Miners or validators try to take an arbitrage position so that a user pays an extra, unanticipated fee. MEV is widely viewed as an unfair practice.
  • MEV first emerged on Ethereum and other EVM-compatible networks. One effective mitigation has been Flashbots.
  • Experts say the shift to Proof-of-Stake (PoS) will not rid Ethereum of MEV, but will segment validators into professional categories, produce different block types and foster long-term strategies based on MEV.

How MEV works

Blocks recorded on a blockchain are immutable and cannot be rewritten. However, miners or validators can include, exclude and reorder transactions in a future block at their discretion before it is confirmed.

Every unconfirmed transaction first lands in the public mempool. Miners then choose which transactions to add to a block. In doing so they assemble the most profitable combination of user transactions.

This invites abuse. Miners (and, after Ethereum’s transition to PoS, validators) favour the largest transactions, prioritising from higher to lower, and add them to the next block that will be recorded on the blockchain.

This feature gave rise to a mechanism for extracting profit by inserting transactions in a desired order. The practice is known as Maximal Extractable Value, or MEV.

The MEV strategy involves searching for speculative operations based on pending transactions and pushing up the effective fees paid for their execution.

Consider a user who decides to swap 10,000 USDC for ETH at $2,000 per coin on a DEX, in a USDC/ETH liquidity pool. Here is what may happen after the order is submitted:

  1. Specialised bots in the mempool track pending transactions and collect data from DeFi applications, including prices and liquidity volumes.
  2. Seeing the intent to buy ETH, the bots trigger an action that lifts the price just before the user’s transaction executes. For example, a bot may add more USDC to the USDC/ETH pool to push up the price of ETH.
  3. The expected $2,000 price becomes, say, $2,500. The trade goes through: instead of 5 ETH, the user receives only 4 ETH. The initiator’s profit is 1 ETH minus fees.

Because MEV increases user costs, it is often called an “invisible tax”, and it is not unique to Ethereum.

When MEV’s “invisible tax” emerged

The problem of “substituting” user transactions—now called MEV—was first raised on Reddit by the algorithmic trader and analyst Pmcgoohan in 2014, before Ethereum’s mainnet launch. He suggested that miners, without breaking any consensus rules, could manipulate user transactions for their own ends.

The term MEV appeared only in 2019 in the paper “Flash Boys 2.0”, the first public study to examine the severity of the problem Pmcgoohan described.

The scale and gravity of the issue drew wider attention only in 2020, in articles such as “Ethereum is a dark forest” and “Escaping the Dark Forest” by Dan Robinson, Georgios Konstantopoulos and the crypto investor Samczsun. These publications aimed to inform Ethereum users about the “invisible tax” levied on them.

Types of MEV

The growth of decentralised finance (DeFi) and parts of the Ethereum ecosystem—particularly price oracles, liquid tokens and cross-chain bridges—has spawned a variety of MEV strategies.

Front-running

The most common tactic, where an MEV transaction is placed before the original one. Special bots can spot potentially profitable operations by simply copying users’ transactions and acting ahead of them.

Back-running

Submitting a transaction in response to an event. For example, right after a new pool appears on Uniswap, an exploiter may buy up a large share of the tokens and take first place in the queue, draining the pool. They then allow other participants to sell and offload their own tokens at a better price.

Sandwich attack

A combination of the two schemes. If a bot finds a large buy order in the mempool, it places its own order ahead to purchase tokens cheaper via front-running. The large order executes and moves the price up. Then, using back-running, the bot sells the coins for a profit before other users.

Liquidation

A strategy aimed at earning profit by buying a collateral position in a lending protocol immediately after it is liquidated. A user sees that a position may be liquidated in the next block and sends a transaction to purchase the collateral.

Uncle bandit attack

A complex MEV strategy based on a speculative chain of transactions discovered in a competing block. Sometimes miners find two blocks simultaneously. At that moment miners can use data from the “neighbouring” block for their own ends.

Time bandit attack

This involves reorganising previous blocks, where miners deliberately propose competing blocks containing different transactions. It can cause transactions to disappear and be included in an entirely different block.

Defences against MEV and Flashbots

MEV is not unique to Ethereum. As DeFi applications have grown and competition has intensified, bots have moved to EVM-compatible blockchains such as Polygon and BNB Chain. Even so, Ethereum has become the most advanced network in tackling the problem.

In 2021, Ethereum miners earned $730m in MEV extraction rewards—4.3% of annual revenue. This points to the rise of “unfair markets” and worsens user experience by increasing fees and reducing predictability of execution.

As a remedy, a centralised system called Flashbots appeared in 2020, funded by the venture firm Paradigm. It does not seek to eliminate the problem, but to bring it under control by creating an open market through a public auction of ETH transactions.

The solution gained traction quickly. According to research by BitMEX’s research arm, by May 2022 more than 90% of Ethereum miners were connected to a Flashbots relay. The researchers noted that 63% of MEV rewards went to operators, with the remaining 37% to miners.

What changes after Ethereum moves to PoS

Experts believe the change of consensus algorithm in Ethereum will not alter the basic principles of block creation. As with mining, validators will still be able to compose blocks from transactions at their discretion.

At the same time, according to Blocknative, Ethereum will see many non-professional node operators. This may lead to a separate category of validators called “block builders”, who will offer services for assembling the most profitable blocks, maximising returns and optimising the network.

As a result, Ethereum could see different types of blocks depending on validators’ needs:

  • Blocks with the maximum number of MEV transactions;
  • Blocks with MEV only for charitable purposes;
  • Blocks with specific gas prices;
  • Time-ordered blocks;
  • Auctioned blocks;
  • Censored blocks;
  • Uncensored blocks.

It is also expected that, because of the specifics of epochs (the process of selecting validators and creating a new block), MEV operators will know in advance which validators will propose the next block. This may give rise to entirely new, long-term MEV strategies.

The developer Elias Simos, having examined the first 24,500 blocks after the Merge, concluded that 18% were produced using a modified mechanism called MEV-Boost. As a result, PoS validators were able to earn 122% more profit, and their blocks contained 41.4% more transactions.

Despite validators’ results from using MEV, it remains difficult to assess the economic and other potential consequences of MEV strategies for ordinary users.

Follow ForkLog on social media

Telegram Instagram
Found a mistake in the text? Highlight it and press CTRL+ENTER.

Рассылки ForkLog: держите руку на пульсе биткоин-индустрии!

We use cookies to improve the quality of our service.

By using this website, you agree to the Privacy policy.

OK