What Is MEV?

Malicious Extractable Value (MEV) is a measure of the profit a blockchain block producer can make through their ability to arbitrarily include, exclude, or re-order transactions during the block production process. It refers to the maximum amount of value that can be extracted from block production in excess of the standard block reward and gas fees.

MEV is also known as Miner Extractable Value (original proof-of-work term) and Maximum Extractable Value.

MEV is applicable to a blockchain that have a consensus model where there is a single elected leader for each block, round or epoch (terminology varies). This leader sees the content of new transactions and can decide what are transactions and which order they are going to be included in the next block, effectively deciding the final execution order of the transcations. The leader can also insert their own transactions to at any point of the new block. If any of transactions contain trades, the leader can insert their own trades before or after the transactions of other blockchain users.

A block producer in a position to do MEV can harm traders in multiple ways:

  • MEV operators frontrun trades and liquidity provisions to get a better price for themselves as they see the market is about to change, by inserting their own trades before others.

  • MEV operators perform sandwitch attack to manipulation the market, by frontrunning and backrunning s single trade to set the price to some arbitrary value.

  • MEV operators backrun trades and extract any arbitrage opportunities which open up after executing a trade.

Because of MEV, traders using blockchain may lose money they would not lost in trading otherwise. Ethereum mainnet block producers have been manipulating on-chain markets via MEV since 2020. This money goes to the block producers as excessive profits from their MEV trades. Most of MEV is a harmful for traders and protocols as it extracts value out from the system and moves it to a third party, unrelated to the actual trading activity. If a rational trader can choose between two otherwise equal markets, they will always choose the market without MEV.

From community acceptance and legal standpoint a third-party MEV, where traders and the protocols are not participants, can be considered harmful:

  • Frontrunning and market manipulation are illegal in many jurisdictions and different contexts.

-Backrunning is generally found acceptable,

especially if it distributes some of arbitrage profits back to traders and protocols.

Not all blockchains are suspectible to MEV. Getting rid of MEV is often referred as “solving MEV” or “minimising MEV.”

MEV can be prevented and mitigated by

  • Making transactions invisible to block producers. This is called to shuttering or shielding. One way to achieve this is to use two-phase commit and reveal scheme, also known as commitment scheme. for including transactions in a block. In this scheme, the block producers ability to see the transaction content is removed. Commit-and-reveal schemes can happen on the block production level (hardcoded for all transactions) or on the application level (a special DEX smart contract needed with two separate transactions). Shutter Network is a commit-and-reveal scheme for EVM block building. Commit-and-reveal schemes usually do not remove the block producers ability to do backrunning.

  • Setting a slippage tolerance for traders. The slippage is the amount of price change between the user creating a trade and the time the trade gets executed. If the trade outcome is not within the slippage tolerance, the trade fails and the trader may try again. The slippage tolerance sets the upper bound for the value frontrun and sandwich attacks can extract. However, the requirement to use tight slippage tolerance to avoid harmful MEV will also cause legimate trades to fail, and MEV participants will still extract value, just lower.

  • Using private mempools. A mempool is a public peer-to-peer network where transactions are broadcasted before they are included in a block. A private mempool operator submits transactions to the block producers with a honour agreement “do not negatively manipulate these” and there is some sort of revenue sharing agreement with the private mempool operator and block producers about this. Multiple private mempool solutions for EVM blockchains exist. Users are incentivised to use a private mempool by paying back some of the backrun arbitrage profits from users trades in the form of a kickback. A simple solution for ordinary users is to change the JSON-RPC node configuraiton of a wallet to point to in the form of a kickback. a private mempool, like MEV Blocker. So far all private mempools are trust-based, so they are not ideal solution as a rogue private mempool operator does not need to respect any honour agreements.

  • Backrunning built into the protocol itself to capture any arbitrage left after routing a trade. Osmosis is doing this if the form of ProtoRev module. More about ProtoRev solution here.

  • Most EVM-compatible blockchains and virtual machines are not powerful enough to do backrunning on-chain, but off-chain solutions like CowSwap and MEV Blocker exist.

  • Creating a blockchain block production system where there is no single leader who can decide on transactions. See Advanced consensys system design presentation here.

  • Having a blockchain that is too dumb to support logic needed to calculate trades. Bitcoin is such a blockchain and that’s why there cannot be trading on Bitcoin, and all of its trading needs to happen outside native Bitcoin blockchain.

  • CEX-DEX arbitrage, though not always MEV but harmful for decentralised finance ecosystem due to its harm for passive liquiditity providers, can be mitigated with dynamic fees, introduced by Uniswap version 4. More on dynamic fees mitigating arbitrage here.

See also

TradingStrategy.ai operated by Trading Strategy Operations Ltd., Victoria, Mahe, Seychelles.