Home / Crypto / Learn / What is MEV in Crypto?

Pick axe extracting ETH out of a rock

Key Takeaways

  • MEV in crypto stands for maximal extractable value. It refers to the maximum profit block builders can extract from blocks of transactions via how they order its contents.
  • There are different MEV strategies, including front running, back running and sandwich attacks. They all make profit by exploiting price movements caused by large pending transactions.
  • Block builders and MEV bots (known as searchers) find profit opportunities by analysing pending transactions in the mempool.
  • MEV is a controversial issue, especially on Etherum, because these block body manipulations often lead to huge losses for regular traders.

You’ve just hit “send” on a high-value crypto swap using a liquidity pool, and you already know how much you’ll receive once the trade is complete. But to your horror, you receive far less than you expected once the transaction is finalized. How is this possible? The answer is a MEV attack – a controversial issue that’s raising big questions about Ethereum and damaging confidence in DeFi.

In this article, we’ll explore MEV, how it works, the different types, and potential attacks, and how you can protect yourself from MEV-related issues.

What Is MEV In Crypto?

Maximal Extractable Value refers to the absolute maximum profit validators can extract from a block of transactions, beyond the standard block rewards and transaction fees. Block builders (validators) are able to do this by reordering, inserting, or excluding transactions within new blocks to manipulate and take advantage of price fluctuations.

MEV originally stood for Miner Extractable Value since it was only available to miner nodes with the ability to structure blocks of transactions. However, the has term changed to reflect the evolving crypto ecosystem: with networks moving toward Proof-of-Stake (PoS), validators are now key players in the MEV story. Furthermore, the advent of MEV bots – also known as searchers – has democratised MEV to some extent, enabling anyone to find opportunities in the mempool. The acronym now denotes Maximal Extractable Value, encompassing this wider story.

How Does MEV Work?

When you trade your crypto, you submit a transaction which will be added to the blockchain’s mempool. For the majority of DeFi transacations, this means Ethereum. Validator nodes (block builders) select transactions from that mempool and use them to fill new blocks. Builders have control over which transactions to include, and how to order them inside the block. This combination of being able to see all pending transaction data, and also being able to control the final block body, gives block builders a huge advantage.

For example, if a validator can see a huge buy order pending in a DEX with low liquidy, he or she knows the price of that token will immediate spike right after the trade.

The validator can insert a transaction of their own before the large trade (front-running), buying a large amount of that same crypto. They can then insert a second transaction to sell that same crypto just after the large purchase order (back-running), profiting from the inevitable price increase. This enables the block builder to earn extra value from that block, beyond transaction fees or block rewards.

Different Types of MEV

Opportunities to extract maximal value from blocks of transactions generally fall into two categories: arbitrage strategies and crypto liquidations. Let’s take a closer look at how MEV strategies fit into these areas.

Crypto Arbitrage

The majority of MEV opportunities are part of a broader strategy of crypto arbitrage. This means selling tokens for a higher value, either on a different platform, or at a more profitable time. For example: platform A might pay more than platform B for ETH at a given time, if its ETH liquidty pools are running low.

Validators have an advantage when it comes to spotting arbitrage opportunities, because they can see large liquidity pool transactions before the rest of the market – and can insert their own transaction directly after it to take advantage of the resulting price fluctuation. A few different strategies may be deployed:

  • Front-Running: The miner/validator spote a profitable sell order in the mempool. They then insert their own transaction before that order, taking the profit of the sale.
  • Back-Running: The validator inserts their own transaction directly after a large transaction to benefit from the price change it will cause. For example, placing a “sell” order directly after a large buy order, benefitting from the temporary price spike.
  • Sandwich Attack: Sandwiching means placing one transaction before and one after a pending transaction, effectively “sandwiching” it between their two transactions.

Types of MEV

Crypto Liquidations

Another fertile area for MEV is the crypto liquidations landscape. Liquidations occur in lending platforms when the value of a user’s collateral falls below a certain threshold, triggering the automatic sale of their assets to cover their debt. Validators can extract value here by prioritizing liquidation transactions and earning fees or rewards for participating in the liquidation process. They may also capitalize on price fluctuations caused by the liquidation by inserting their own buy or sell transaction directly after it.

What Is a MEV Attack?

We mentioned at the beginning that MEV is a source of controversy – let’s come back to that.

The “value” extracted by MEV ultimately benefits validators at the expense of regular traders. For example, front-running a profitable trade in the mempool takes the profit from the trader who spotted the opportunity and gives it to the block builder. Sandwiching and front-running are often labelled as MEV attacks, because while the validator benefits, the traders become victims, losing their profits in the process. 

One recent example on Uniswap saw a trader lose more than $200k when he was targeted by a sandwich attack. So while MEV is a logical outcome within the blockchain ecosystem, it shows the distinct advantages certain entities have over regular users. These tactics can result in higher transaction fees for regular users or worse execution prices on trades. This has led to some important discussion on just how democratic the blockchain actually is.

How to Avoid MEV Attacks

Fortunately, there are strategies and tools available that can help users avoid falling victim to MEV attacks.

RPC Endpoints (MEV Blockers)

One of the best defenses against MEV attacks is using MEV-blocking RPC endpoints. These specialized endpoints encrypt transaction data until it reaches the blockchain preventing anyone from seeing it in advance. This makes it harder for miners to interfere with the transaction.

Lower Slippage Tolerance

Slippage tolerance refers to the maximum price change a user is willing to accept when executing a trade on a decentralized exchange. By lowering slippage tolerance, users can reduce the chances of MEV attacks.

Priority Gas Fees

Another way to avoid MEV attacks is by using priority gas fees, which allow users to pay a higher fee to ensure their transactions get priority. This minimizes the time that a transaction is pending, reducing the chances of being front-run or back-run by a miner.

DEX-Native MEV Protection

Some decentralized exchanges (DEXs) have a built-in MEV protection mechanism. These platforms include features like randomized transaction ordering, encrypted mempools, or other solutions to make it more difficult for miners to exploit MEV.

Closing Thoughts

MEV plays a significant role in the economics of blockchain networks, particularly within DeFi. It provides additional incentives for miners and validators but it also introduces risks to users through front-running and sandwich attacks. Understanding how MEV works and adopting strategies to mitigate its impact can help users protect their investments in the crypto space.

Was this Article helpful? Yes No
Thank you for your feedback. 100% 0%