What You Should Know When First Learning about MEV

BY Sophie Z · 10 / 08 / 2023

This article aims to provide a clear understanding of MEV (Maximal Extractable Value) for readers with prior knowledge of blockchain and familiarity with certain terminologies. It assumes a basic understanding of blockchain concepts.

MEV refers to the potential profit that miners can achieve by manipulating the inclusion, exclusion, or re-order of transactions within the blocks they produce. It's important to note that the term "maximal" is relative and not a fixed number. The potential for profit varies based on the current state of the blockchain.

Why is there profit in MEV?

MEV profit arises due to the time delay between submitting transactions to the mempool and their inclusion in blocks. This delay creates opportunities for financial activities like arbitrage.

In more detail, MEV takes advantage of the inherent latency and competition in blockchain transactions. When a user submits a transaction, it is broadcast to the network and awaits confirmation in the mempool. Validators select transactions from the mempool, often prioritizing those with the highest fees. By strategically manipulating the order of transactions within a block, an actor with influence over the process can maximize their own profits at the expense of others.

How does it work?

MEV searchers utilize automated bots to identify profitable opportunities on decentralized exchanges (DEXs). These bots run complex algorithms and quickly submit profitable transactions to the network, ensuring they capture the value before others do.

This creates an interesting dynamic between searchers and block producers. Since searchers pay high gas fees to ensure their profitable transactions, up to 99.99% of the profit goes to the producers. Consequently, producers can receive over 90% of the MEV profit margin in addition to the block rewards. The higher the competition for an opportunity, the greater the incentive to engage in this practice. It can be seen as a second-hand reallocation of MEV, with validators being effectively "hired" by miners to extract MEV and get paid, although their share is typically only 10%.

Some Examples

  1. Generalized frontrunning: Bots scan transactions in the public mempool, replace addresses in the transaction payload with their own, and simulate transaction execution to identify potential profits. By submitting identical transactions with higher fees to block producers, generalized frontrunners can capture the value without fully understanding the transaction's underlying purpose.

  2. Flashbots: Flashbots is a separate project that allows searchers to submit maximum extractable value transactions to validators without revealing them to the public mempool. This prevents transactions from being front-run by generalized frontrunners.

  3. Sandwich attacks: In a sandwich attack, a frontrunner "sandwiches" a user's transaction by submitting one transaction before and one after the user's transaction. This maximizes profit, again at the expense of unsuspecting users.

    To execute sandwich transactions, searchers monitor large transactions in the mempool of DEXs. For example, if someone wants to buy 10,000 UNI on Uniswap using DAI, this large transaction can significantly impact the UNI/DAI pair's price, causing UNI's price to increase relative to DAI. The searcher calculates the approximate price impact of this large transaction on the UNI/DAI pair and executes an optimal buy order just before the large transaction to purchase UNI at a low price. They then execute a sell order immediately after the large transaction to sell UNI at the higher price caused by the large order.

  4. Exchange arbitrage: Arbitrage is a common market activity where traders exploit price discrepancies of an asset between different exchanges to make a profit. In the context of MEV, bots monitor the transaction mempool, replicate arbitrage trades, and pay higher fees to block producers to prioritize their transactions over the original ones.

  5. Liquidations: Searchers or block producers use bots to identify and trigger the liquidation of collateralized loans, capturing the liquidation rewards for themselves.



"Bitcoin and Cryptocurrency Technologies" by Arvind Narayanan et al.

Ethereum Documentation: https://ethereum.org/zh/developers/docs/

CoinMarketCap Glossary: https://coinmarketcap.com/alexandria/glossary/miner-extractable-value-mev