Table of Contents
What is Miner Extractable Value (MEV)?
MEV stands for “Miner Extractable Value” and is sometimes referred to as “Maximal Extractable Value”. As the name suggests, it refers to the extraction of value from blocks within a blockchain. Before talking about MEV, it’s important to understand the existing incentive mechanisms that miners have. For Bitcoin, for example, the incentive comes from two places: a block reward for mining the block and transaction fees associated with transactions within a block. The current block reward for Bitcoin Is 6.25 Bitcoin for every block mined and at the time of writing the average fees per block are 0.08 Bitcoin. So, the transaction fees only make up a very small percentage of the incentive (around 1.34%) with the lion’s share coming from block rewards. As time goes on this will change as a result of the “Bitcoin Halving”, but for the moment this is what the incentive model looks like.
To send transactions on the Bitcoin Blockchain users have to pay a fee to the miners (also known as validators or block producers). Users can select to set these fees higher or lower within a certain range. Typically a miner is incentivised to include transactions with a higher fee in a block to maximize the transaction fee portion of the incentive and this is why if you pay a higher fee, you’ll have a quicker confirmation. However, it is at the miner’s discretion as to what transactions to include and in what order to place the transactions within the block. This is a lot of power and means that miners who produce the blocks can potentially extract value by reordering, inserting, and censoring transactions within the blockchain.
Users submit transactions they want to be processed to the “mempool” where they are stored until they are added to the Blockchain. Generally speaking, miners will look at the “mempool” and choose to include transactions with a higher fee in a block to maximize their profits. Then within the block, they will begin ordering based on transaction fee so transactions in the mempool with a relatively higher fee get added to the top of the block. However, there’s no requirement within the system that says a miner must order based on fee and instead the miner has full discretion.
To enhance profits a miner can look to deploy different strategies such as reordering, front running, back running and arbitrage. In front running a miner can see particular transactions happening that may indicate the price will go in a particular direction. They could then use this knowledge to place their own transaction in the block they are mining to take advantage of the potential change in price. We’ll look into some MEV strategies in more detail below and see why they might be harmful to regular crypto users.
Key takeaway: Miners order transactions to maximize their income. A miner can reorder, insert, and censor transactions within blocks to extract additional value from users.
What is the value of MEV?
According to Flashbots, It is estimated that more than $759M of MEV has been extracted since 1st January 2020. This is just the MEV recorded on Ethereum and the actual value across all blockchains is likely a lot higher.
When was MEV first discovered?
The concept of MEV was first discovered by Pmcgoohan (a pseudonym) over 7 years ago and even before Ethereum had launched. In a Reddit post, the potential for Ethereum miners to front-run transactions was first raised as a concern. The post got quite a few comments but didn’t result in any changes and the MEV problem has materialized.
Although the concept was first described in 2014, the term MEV itself was coined in 2019 with the publication of a paper written by researchers at Cornell Tech. The Flash Boys 2.0 paper, explores the increasing use of arbitrage bots within the Decentralized Exchanges (DeX) space. The paper also highlights the systemic risks that MEV poses to the Ethereum blockchain today.
Did you know? The original flash boys is a popular book written by Michael Lewis that revealed tactics like High Frequency Trading (HFT) and front running used by insiders on Wall street.
How do miners profit from MEV?
There are a few different strategies that miners can utilize to extract profits from users.
Front running, back running and the sandwich trade
Let’s look at an example to illustrate using the Uniswap automated market maker (AMM). Uniswap allows tokens to be traded without counterparties within a decentralized finance (DeFi) system.
Alice is buying a large volume of ETH for USDC using the Uniswap pool USDC/ETH. Buying ETH from Uniswap causes the price of ETH to rise with respect to a USDC. The Miner can see this transaction and sets up a sandwich as follows:
Miner front runs their transaction: A miner knows that this order will increase the price of ETH in the Uniswap Pool so they create their own transaction ( transaction A) that is executed before Alice. The miner’s transaction pushed up the price of ETH.
The sandwich: Alice’s transaction gets executed after the miners and suffers from high slippage. The slippage is caused by the difference in the expected execution price and the actual execution price. In this case, the price Alice actually needs to pay to execute the trade is higher because the miner placed their own transaction first. Essentially the miner is taking money from the user Alice.
The miner then back runs their own transaction: The ETH tokens that the miner bought are sold again immediately after Alice’s trade to make a profit for the miner.
Arbitrage (with “flash loans”)
Bots (algorithmic trading bots) monitor the mempool and try to sniff out opportunities to profit from arbitrage. The Ethereum mempool in particular has many arbitrage bots operating to take advantage of different DEX pricing. These bots perform an important function in keeping market’s running efficiently with competitive pricing.
Here is an example of a single transaction that took advantage of different pricing of the ETH/DAI pair on Uniswap vs. Sushiswap.
In this case a single Ethereum transaction is executed that involves a flash loan of 1000 ETH from Aave. The loaned ETH is swapped for Dai on Uniswap and then the DAI is traded back to ETH on Sushiswap, taking advantage of the different pricing on the two markets. The arbitrage opportunity resulted in a profit of 45 ETH with the 1,000 ETh flash loan retired within the same transaction. A quick and risk-free profit is made.
Did you know? A flash loan is when funds are borrowed and returned within seconds and without collateral – in the space of one transaction so there is no risk that the borrower defaults
These arbitrage opportunities are typically executed by traders, but there’s an opportunity for miners to see these transactions and instead of executing the transaction for the trader they create their own transaction to take advantage of the opportunity. This has created a situation where miners and traders can benefit from working together on these arbitrage opportunities.
Priority Gas Auctions (PGAs)
The existence of arbitrage profits creates a competitive environment where trading bots effectively bid against each other to get their transaction confirmed first by offering higher transaction fees to miners. This pushes up transaction fees across the board for regular users. The miner benefits as a result of the increased fees paid by users which is like an invisible tax.
Censoring, excluding or blocking transactions
With the ability to decide what transactions go into a block also comes the ability to decide what doesn’t. In the arbitrage example above the miner temporarily censored Alice’s transaction in order to capture the opportunity themselves. A miner might have a position in a cryptocurrency and see a transaction in the mempool that will put downward pressure on the price. In this case the miner could decide to exclude this transaction in the block and instead put in their own sell transaction first.
What is Pool Extractable Value?
The notion of MEV is not just isolated to Proof of Work (PoW). Proof of stake (PoS) cryptocurrencies like Cardano are also susceptible to MEV. With Pool Extractable Value (PEV), the stake pool operators “mint” blocks and can decide what transactions to include. This can create the same MEV incentives that exist on PoW chains.
Decentralized Finance (DeFI) and MEV
Most MEV today happens on Ethereum and most of the value is extracted by traders using arbitrage between pricing on different Decentralized Finance protocols. Miners indirectly profit from these traders’ transaction fees, but also could simply decide to run this strategy themselves using their own bots and censor the traders’ transactions. When these arbitrage bots are run by the miners themselves, it can create a conflict of interest.
It’s no surprise that the Uniswap, which is the biggest DEX on Etherum, is where a lot of MEV activity happens.
Pros and cons of MEV
- DEX arbitrage ensures that users get the best prices
- Arbitrage bots can help balance out prices across different markets.
- Front running and sandwich trading may result in increased slippage for users
- Priority Gas Auctions ( PGAs) cause higher fees for regular users and result in network congestion
- Can incentivize “Time bandit attacks” which is when miners rewrite blockchain history by mining blocks in the past to steal funds allocated by smart contracts in the past
- It may result in additional costs for people running nodes
How to defend against MEV?
It’s clear that MEV is a problem and something that many consider to be an existential threat to Ethereum in particular. It’s not just an Ethereum problem, but has implications for many smart contract chains. There are many different proposals on how to deal with the issues around MEV.
Flashbots is an organization formed to mitigate the negative externalities and existential risks posed by MEV. They have developed many tools including “flashbot auction” and “flashbot protect”. With flashbot auction there is a private transaction pool and blind auctin to enable more efficient MEV extraction and frontrunning protection.
Chainlink labs have also developed a Fair Sequencing Services (FSS) to minimize the impact of MEV. The idea essentially is to have an oracle network order the transaction, taking this power away from miners.
Dapp designers can also use more “MEV-resistant” design patterns in their smart contracts to hide transactions and prevent front-runnin
MEV profits are becoming an increasingly large part of miners’ economic rewards, making the threat of attacks and reorgs more likely. As the value of a token and network grows this threat could pose an existential risk to the network and its underlying projects that could result in major disruption via loss of confidence, trust and value to token holders and users.
The MEV described here is visible on open public blockchains like Ethereum. In particular, most of the MEV stems from arbitrage opportunities in different DEX pricing. However, the volume traded on decentralized exchanges is a tiny percentage of the volume that is traded on centralized exchanges like Binance, Coinbase and Kraken. The activity on exchanges is “off-chain”, so cannot easily be audited without privileged access. Unscrupulous exchanges themselves could easily use tactics like front running to make profits.
Subscribe to our newsletter