Publisher avatar
LearnCrypto
16 min read

What is Maximal Extractable Value? MEV Explained

What is Maximal Extractable Value? MEV Explained
  • In 2021 and 2022, at least $675 million in MEV profits have been realised on the Ethereum network alone. When taking into account other blockchains such as Solana and Binance Smart Chain, the total MEV market value exceeds $1 billion in profits.

What is Maximal Extractable Value (MEV)?

Maximal Extractable Value (MEV), also known by its past name Miner Extractable Value, refers to a measure of the profit a miner (or validator) can make through its ability to include, exclude, or re-order transactions within the blocks. 

Mining is a process by which cryptocurrencies confirm new transactions and add them to the existing blockchain, through the creation of new blocks. For the work they do, miners are rewarded with new cryptocurrency.  

To learn more about mining and its monetary opportunities, check out this article: ‘How to earn crypto: Earning from mining crypto’. 

Therefore, Maximal Extractable Value can be defined as the total profit that can be derived from ordering transactions on the blockchain. Due to the expansion of decentralised finance (DeFi), MEV became an important and relevant topic. The number and complexity of financial transactions on DeFi platforms have increased. However, the potential for these platforms to be exploited by malicious actors has increased as well.

loading...

A. Explain MEV like I'm five

To understand the concept, you should be aware of how transactions are added to a blockchain. When a transaction is signed, it moves along to an unconfirmed status in a pool where miners can access them and add them to a block within the blockchain network. Due to the decentralised nature of blockchain, the network itself is responsible for validating transactions and adding them to the blockchain. The balances on the distributed ledger are updated accordingly. 

For example, Peter wants to send 5 ETH to Ivy. This transaction is first added to a pool filled with pending transactions. All these transactions, including Peter’s transaction, are verified by miners (validators). Once the transaction has been verified, the record of this transaction is added to the blockchain, and the balances are updated. Now Peter’s balance equals minus 5 ETH, and Ivy’s balance equals plus 5 ETH. 

Miners can extract value by changing the order of transactions in a block or capitalise on their knowledge of incoming transactions to extract value. The concept of searchers has been introduced to describe people or bots that search for opportunities to extract value by looking at transactions in the crypto pool. 

It sounds logical that transactions would be chosen based on their profitability. For example, those with the highest fees shall be selected first. This is, for example, why users pay higher transaction fees or gas fees during busy periods to ensure their transactions are selected first. As a consequence, transactions with lower fees have to wait a bit more to be verified and included in a block. 

However, transactions don’t have to be ordered based on fees. There is no rule that dictates that kind of selection. When transactions, for example, involve complex information, validators can include, exclude or reorder those transactions to make extra profit beyond the standard rewards and fees. 

When it comes to validating transactions, divergent blockchains use different models – crypto consensus mechanisms. For example, Bitcoin uses the Proof-of-Work (PoW) consensus protocol, and Ethereum switched to the Proof-of-Stake model. 

Therefore, MEV is a way for miners to make money by processing users’ transactions. Sometimes it is referred to as an invisible tax that miners can collect from users - in the form of the maximum value a miner can extract from moving around transactions when producing a block within the blockchain ecosystem. 

B. Brief History: From Miner Extractable Value to profitable Maximal Extractable Value

The MEV activity was first predicted back in 2014 by an algorithmic trader known as Pmcgoohan who pointed out in a Reddit post that miners can rearrange transactions in a pool of unverified transactions for personal gain. 

The MEV topic emerged primarily as a concern related to the expansion of DeFi platforms that rely on complex financial transactions and smart contract technology. As DeFi platforms gained more and more popularity throughout the years, it became clear that they could be exploited.  

The term ‘Miner Extractable Value’ was coined by researchers Phil Daian, Tyler Kell, Steven Goldfeder, and Ari Juels in a 2019 paper known as ‘Flash Boys 2.0: Frontrunning, Transaction Reordering and Consensus Instability in Decentralised Exchanges’. 

 A year after, the concept of Maximal Extractable Value was built into crypto economics and deemed a challenging issue for Ethereum thanks to papers issued by Georgios Konstantopoulos and Dan Robinson. The researchers described this concept on the Ethereum blockchain as a dark forest.

In other words, it refers to a highly adversarial virtual environment where the frequency of new hacks indicates that a number of people are spending their time examining smart contracts for vulnerabilities. However, the whole chain may be a battleground, but the mempool as the set of pending transactions, is the dark forest. 

MEV has most often been associated with the Ethereum network due to its decentralised finance ecosystem. The more complex the transactions involved in a block are, for example, smart contracts linked to lending, borrowing, or trading, the more opportunities there will be for block producers to gain profit by deciding how to deal with transaction ordering.

Currently, this concept is known solely as Maximal Extractable Value. Even though these two terms are frequently used interchangeably, there is a slight difference. Maximal Extractable Value is a wider concept since it applies to any actor with the ability to manipulate transactions on the blockchain, and not just miners.

How does MEV extraction work?

The main idea behind the MEV concept is that transactions compete with each other for confirmation. As explained above, a user submits a transaction that is broadcast to the blockchain network and placed in a pool filled with pending transactions known as the transaction mempool.

Miners and validators detect profitable MEV opportunities and accordingly tend to choose particular transactions first, such as transactions with highest fees. By strategically manipulating and ordering transactions within a block enables them to earn more at the expense of others.

What is an MEV searcher?

Even though it seems that MEV is a strategy that benefits block producers solely, a significant amount of MEV extraction is secured by independent network participants known as searchers. These searchers employ automated bots to seek profitable MEV opportunities on decentralised exchanges (DEXs) to capture the value before others.

Bots run complex algorithms and submit profitable transactions to the network rapidly, ensuring they can capture the value before others do. The more competition there is to seize a profitable opportunity, the higher the incentives are to engage in this activity. 

All this adds up to the interesting dynamic between original block producers and MEV searchers. Since searchers tend to pay high gas fees to guarantee their transactions, up to 99.99% of the profit can still go to producers. Therefore, in some cases block producers receive more than 90% of the MEV profit margin on top of the block rewards.

Common methods of MEV extraction techniques

Different methods of extracting MEV are available in blockchains. While a definitive list of MEV extraction techniques would be challenging to collect due to the ever-changing nature of the concept, there are a few well-documented examples to look at.

A. Gas Golfing

Gas golfing refers to the activity of programming transactions so that they use a minimal amount of gas. This example is a competitive advantage since it enables searchers to set a higher gas price while keeping their total gas fees at a constant level.  

Gas golfing strategies include using addresses that start with many zeroes since they take less space to store which equals less gas.  

By submitting a transaction with a low gas price, it may temporarily lead to network congestion and push up gas prices. Then a second transaction with a higher gas fee can be submitted to take advantage of the higher price.

B. Generalised Front-running

Unlike gas golfing, the frontrunner doesn't focus on optimising a smart contract for the identification of profitable transactions. Instead, it monitors unconfirmed transactions, identifying profitable deals and launching the initial transaction with lower gas prices to submit the transactions.

Front-running refers to the use of flashbots that exploit the traders of users through transaction order manipulation. Flashbots monitor the mempool to find profitable MEV opportunities.  

Once the bot detects a profitable opportunity, it replicates a user’s transaction with a higher gas price so that miners choose that transaction over others. The bot runs the transaction first locally to double-check the modified transaction results. If the transaction turns out to be truly profitable, the bot then frontruns the original transaction.

C. Sandwiching

popular form of market exploitation on the blockchain. To start off with sandwiching, the searcher will keep an eye on the mempool for large trades performed on decentralised exchanges. For example, the searcher detects an order to buy 100,000 USDC worth of ETH via the Uniswap exchange. A trade of this kind of magnitude could affect the fluctuation of cryptocurrencies on the market.  

A searcher detects the transaction and calculates the approximate price effect of this trade order on the pair of cryptocurrencies that are being exchanged and executes an optimal buy order right before the execution of the large transaction. The result is that one cryptocurrency is bought cheaper at first and sold later at a raised price. 

To sandwich, a searcher will watch the mempool for large DEX trades. For instance, suppose someone wants to buy 10,000 UNI with DAI on Uniswap. A trade of this magnitude will have a meaningful effect on the UNI/DAI pair, potentially significantly raising the price of UNI relative to DAI. 

Sandwiching is also sometimes referred to as the sandwich attack, representing a malicious type of frontrunning that is used to manipulate cryptocurrency prices on the market to gain profits from an artificial price change. 

D. DEX Arbitrage

Decentralised exchange (DEX) arbitrage is considered the simplest MEV strategy. Since it is the most notorious strategy as well, it is quite competitive. 

Tokens often have different prices on decentralised exchanges due to varying demand. If there is a significant price difference between two exchanges and MEV bots spot it, they will proceed to buying lower-priced tokens on one exchange to sell them right away on another exchange at a higher price. 

The outcome is that token prices across various decentralised exchanges become more aligned and the DeFi market becomes instantly more efficient. The competitive method is also a lucrative one since a well-conducted arbitrage transaction results in a decent number of profits.

E. Liquidations

out loans by depositing digital assets as collaterals. If the market changes and the value of the collateral drops below a particular price level, that position is deemed liquidated. 

If you want to find out more about DeFi borrowing and lending, we suggest reading this article: ‘How to earn crypto: What is DeFi automated borrowing & lending?’.

Therefore, if the value of borrowed assets exceeds the value of the collateral at a particular percentage, the lending protocol typically allows any user to liquidate the collateral and pay off the lender. When liquidated, the borrower is typically required to pay a big liquidation fee and some of that fee goes directly to the liquidator. This is where we can spot a MEV opportunity. 

Therefore, searchers scan blockchain data rapidly to determine borrowers that could be liquidated and tend to be the first to submit a liquidation transaction to collect the liquidation fee afterwards.

F. Back-running

Back-running is about, similar to the frontrunning activity, monitoring of a mempool to execute a profitable transaction right after a pending target transaction. To do this, searchers use back-running bots that detect broad transactions. 

When the back-running bot detects a preferable transaction, it conducts an opposite trade on the same mempool to maximise the holder’s profit. Back-running typically works by leveraging the price difference caused by the original pending transaction.

G. Time Bandit Attack

Time bandit attacks are an MEV strategy that involves the reordering of past blocks. This type basically includes the need to rewrite the main Ethereum chain to produce another version of transaction history.  

This strategy produces negative effects as it decreases user experience and the stability of the blockchain network. Imagine your transaction being confirmed and then it suddenly goes away. 

This method is hard to pull off as it simply means that miners would need to split the network using broad amounts of computational power or hash power. In fact, they would need approximately 40% of total hash power to utilise a time bandit attack.

H. Uncle Bandit Attack

In the Ethereum network usually, two blocks are mined at the same time, and only one of them can be added to the chain. The other becomes orphaned or ‘uncled’. Anyone is allowed to access transactions in an uncled block. It is like transactions ending in a sort of pool again where they are public. 

Unlike time bandit attacks when a new version of history is created by seeing something late in time and rewinding it, the uncle bandit attack refers to a situation when the searcher sees something in an uncled block and brings it forward. 

All shades of Maximal Extractable Value - The good, the bad and the ugly.

When talking about MEV effects, it is usually understood that it negatively affects unsuspecting end-users and therefore results in a decreased user experience. If it is done with malicious intent, it can skyrocket gas fees and add up to network congestion. 

However, MEV has been the subject of several discussions within the crypto community, and it still plays a major role in the whole blockchain ecosystem. Let's take a look at all MEV's. aspects.

The good side of MEV

Instead of trying to solve MEV issues, there is a side of the crypto community that thinks they should be building the tools necessary to provide access to MEV. 

Good sides of the Maximum Extractable Value concept refer to its usefulness in relation to DeFi projects and DeFi lending protocols as MEV amounts to rapid and seamless liquidations. Additionally, MEV proponents point out that MEV is the key to fixing economic inefficiencies of DeFi protocols. 

A group of researchers created an organisation known as Flashbots that works on mitigating risks associated with MEX extraction methods. The organisation has produced MEV-Geth, a product that provides front-running as a service (FaaS) with a primary focus to enable a transparent, open-source, and fair ecosystem for extracting MEV.

Why is MEV bad?

As mentioned above in the text, MEV has the power to cause a poor user experience due to more expensive transactions and loss of revenue. For instance, strategies such as sandwiching and front-running can cause ordinary end-users millions of dollars worth of losses due to lost arbitrage opportunities and increased price slippages.  

The bad sides of MEV and the employment of specific strategies affects amateur traders. Another example is related to the arbitrage technique; MEV bots make it really hard for ordinary users to participate. It can basically be an unwinnable game for them. 

Another problem occurs when front-running bots compete by increasing gas fees. Since this can result in high transaction fees and network congestion, consequences are again suffered by ordinary end-users.

What is so ugly about MEV?

There are some statements within the crypto community claiming that MEV worsens the network at a protocol level. For instance, if MEV rewards turn out to be bigger than block rewards, this might incentivise miners or validators to destabilise the consensus of the blockchain network. 

One side of the crypto community thinks that MEV is not bad, but really ugly because it might go after the foundations of blockchain technology such as its secure, permissionless, and immutable nature. In other words, MEV may be viewed as an incentive to miners or validators to take a more active role instead of just being a neutral party.

MEV on Ethereum after the Merge - What's next?

Ethereum’s transition to a Proof-of-Stake consensus mechanism is called ‘The Merge’. The Merge doesn’t mean an end for MEV. In fact, a modified MEV system emerged that is adapted to the new consensus mechanism. 

Just a few days after the update happened, 24,000 blocks were examined. Approximately 18% of them were generated using MEV and provided additional rewards to validators. Due to the new MEV-Boost system, those validators managed to get 122% more profit. 

loading...

The MEV-Boost system consists of the Builder API, block builders, relayers, and the escrow. Let’s explain these components briefly. 

The Builder API is used to connect clients responsible for creating blocks and consensus clients that propose blocks. Then we have the so-called block builders that invest in specialised equipment that is required for the production of blocks. 

When block builders receive transactions from seekers, they use strategies to create the most profitable blocks. Additionally, there is a change when it comes to verifying transactions. 

First, we have relayers that validate blocks before passing them on to validators. Their other purpose is to value the MEV reward and safeguard the network’s security. When the content of the block gets from the relayer to the escrow, that means that the data is available to the validator.