From Niche to Mainstream: A Complete Guide to MEV

Brandon Sanchez
PoN-network
Published in
10 min readFeb 14, 2023

Maximal Extractable Value is a recent phenomenon in the decentralized world that has been compared to the olympics for software developers.

MEV can be compared high frequency trading in the stock market, but with cryptocurrencies and within blockchains. With hundreds of millions of dollars in volume generated since 2020, interest in MEV has also exploded. However, the technical complexity and obfuscation of information surrounding MEV can make it a difficult and intimidating topic to understand, especially given that many players in the MEV space prefer to keep things secret for less competition. The lack of transparency leads to a high barrier to entry, little documentation that is digestible, and confusion for those attempting to navigate these murky waters.

But have no fear, we’re here to make MEV easier to understand.

Key Takeaways:

  • MEV is a process of extracting value from blockchain networks, similar to high frequency trading with stocks.
  • Searchers play an active role in finding MEV opportunities in the mempool and send transaction bundles to block builders.
  • Block builders build complete blocks that go into the blockchain.
  • Mempools serve as a holding area for unconfirmed transactions in a blockchain network.
  • Relays work in conjunction with searchers and validators to guarantee that promises made during MEV extraction are fulfilled.

An Allegory…

MEV can be understood by comparing it to buying a sandwich. Imagine you knew which sandwich would taste the best before ever trying it. By using that insider information, you can purchase the best sandwich and enjoy your meal more than someone who does not have that information. In the world of crypto, a searcher utilizes blockchain data in the mempool to predict the future state of the blockchain and capitalize on it.

What is MEV?

Maximal Extractable Value (MEV) refers to the monetary value that can be earned by the reordering, insertion, or censorship of transactions within a block being created.

You can think about MEV like high frequency trading in the stock market, ex with cryptocurrencies and within blockchains.The term MEV, initially known as Miner Extractable Value, originated during the Proof-of-Work era of Ethereum when miners controlled which blocks and transactions were inserted into the blockchain. Ethereum’s move to Proof-of-Stake (PoS) saw power over block proposal transition from miners to validators, but the pursuit of profit through manipulating transactions remained, so now the term “Maximal Extractable Value” is used.

Researchers estimate that over $908.3 million worth of MEV has been extracted since 2020. Quantifying the exact amount is challenging because extraction techniques are designed to be concealed to maintain a competitive advantage. As a result, the actual dollar amount of MEV volume is expected to be much higher than just what researchers can identify and confirm.

But how do people extract value from a blockchain?

It becomes simple when you break down the key components in MEV: searchers, builders, validators, mempools, and relays.

Blockchain and Mempools

To understand MEV, it is necessary to understand what a mempool is and how a blockchain works.

The blocks in the Ethereum blockchain store records of all the transactions that have ever happened. Once a block is finalized and included in the blockchain, it can never be changed. Hashing creates a cryptographic link between each block, forming an unalterable chain in the blockchain that is easily verifiable.

This permanence made it necessary to have a mechanism that enables transaction ordering and block construction before block finalization. So lets consider where transactions wait before they are finalized…

The mempool.

Mempools reside within validators, acting as a “holding memory pool” of pending transactions waiting to be added to the blockchain. Transactions in a mempool are prioritized and ordered by fee, where a higher transaction fee increases the likelihood of a quicker inclusion into the blockchain.

The traditional process for transactions entering the blockchain is as follows:

  1. A user initiates a transaction and signs that transaction with their wallet.
  2. A validator verifies the transaction’s validity and adds it to its mempool.
  3. The transaction is broadcast to the validator’s peers, entering their mempools.
  4. A validator is selected to propose a block into the blockchain.
  5. A block is built using transactions from the mempool and submitted to the blockchain.
  6. The new block is broadcasted across the network, removing transactions included in the finalized block from the mempool.
This image is of transactions passing through a validator’s mempool and to form a block that is proposed into the blockchain (no searcher’s or relays involved).

So now that we have established an understanding of the mempool, let’s explore how searchers use mempools to extract MEV.

Searchers and Block Builders

Searchers are highly skilled individuals or groups of individuals that search the mempool for MEV extraction opportunities and build blocks that are profitable for them if proposed into the blockchain. Searchers interact with the mempool to monitor unconfirmed transactions and gain insight into imminent transactions before they are permanently recorded into the blockchain.

Searchers employ strategic techniques, including simulations, algorithms, and bots, to swiftly calculate profitable MEV opportunities using transaction information in the mempool within milliseconds or even nanoseconds. In the fast-paced world of cryptocurrency, this high-speed execution is necessary for searchers to stay ahead of the competition and seize lucrative MEV extraction opportunities. But how do they do this?

When there is a profitable MEV opportunity, there is a race for searchers’ bots to capture it.

Searchers use the pending transactions in the mempool as information to simulate future blockchain scenarios and calculate the potential for profit. The algorithms and strategies used are rapidly executed and searchers construct a “block bundle” by reordering, censoring, or inserting transactions in a way that extracts MEV if that block bundle is included in the blockchain. A block bundle is a series of transactions, organized by the searcher, which is sent to a block builder. The block builder constructs a block using data from the mempool and block bundles from searchers to create a complete block. This completed block includes a payment to the validator as the last transaction to incentivize its inclusion into the blockchain.

In obvious MEV opportunities, the competition is intense, with some of the smartest coders in the world going head to head to create the fastest bot and build a profitable block and only the smallest fractions of time to separate the winning block from the rest. Searchers and block builders compete in an auction-like bidding process to secure inclusion in the blockchain, with the winner being the highest tipper at the end of the 12 seconds between Ethereum blocks.

High-frequency trading bots hunt for MEV all day, every day, between every single block. But their success relies on the cooperation of validators.

Validators

Validators are digital entities that are responsible for storing data, processing transactions, and proposing blocks to the blockchain. It takes 32 ETH to create a validator, but now with liquid staking derivatives it can be fractionalized and users can stake for less. Validators earn staking rewards and are essential for ensuring the network’s security by validating transactions. They also have a validator key to sign off on the network’s state and propose blocks when it is their turn.

Every 12 seconds, the Ethereum network selects a validator to build and propose a block to the blockchain. Block builders must collaborate with validators to have their blocks published into the blockchain since validators hold the key to propose blocks.

But how do validators and block builders trust that the opposing party does not act maliciously?

This is where relays come in.

Relays

A relay is a third-party intermediary between validators and block builders, offering a layer of security that does not exist without it (block builders can be searchers and validators since validators can also build blocks). Both parties have a financial incentive to interact with the relay to obtain a set of guarantees.

Relays ensure that:

  • The searcher’s tip from the winning bid is included in the block bundle and sent to the validator.
  • The block contents are protected to prevent validators from stealing a searcher’s MEV strategy or remaking the block bundle themselves.

Relays become an important role in the block proposal process. The process flow for block proposals including a relay, searchers, and their block bundles is as follows:

  1. The relay verifies the searcher’s tip from the winning bid.
  2. The block bundle’s header is sent to the validator, concealing the block’s transactions.
  3. The validator signs the block header and returns it to the relay.
  4. The validator passes the signed block header back to the relay.
  5. The relay releases the complete block signed with the validator signature back to the validator to be proposed into the blockchain.
  6. A new block is added to the blockchain.
This image depicts the block proposal process including relays, block builders, validators.

In recent years, the use of relays has exploded in growth parallel with increasing interest and involvement in MEV. What used to be a niche activity for miners/validators who wanted to outsource block building and sell block space has now become the primary method of block proposal due to the attractiveness of the increased rewards, transforming the blockchain landscape as we know it.

It is estimated that the majority of blocks are now routed through relays prior to being added to the Ethereum blockchain. Dealing with MEV can be confusing, as it is viewed as both a challenge and an essential aspect of the decentralized markets.

MEV in Decentralized Markets

MEV can play a dual role in decentralized markets, serving as both a necessary function for market efficiency and can also create inefficiencies in the network. Regardless of how a participant chooses to execute their MEV strategies, it is important that they are able to have full autonomy and will not be censored in their strategies.

Necessary MEV

In some cases, MEV keeps decentralized protocols efficient. For instance, searchers help keep the prices of assets consistent across different decentralized exchanges (DEX) by capitalizing on disparities in prices and extracting the MEV, also known as DEX arbitrage. Since decentralized exchanges keep their own liquidity pools when holding assets, the price of assets reflects the actual liquidity of the decentralized exchanges, and a third party is needed to keep the prices consistent.

Similarly, searchers’ liquidation bots play an important role in maintaining the stability of decentralized protocols by monitoring price fluctuations and triggering liquidations when required, profiting from this while also safeguarding the funds in these protocols.

Front-Running Examples

Front-running is a type of MEV strategy that can be thought to cause network congestion and contribute to expensive gas fees due to the bidding wars of MEV searchers.

One example is the “sandwich attack”, which is a type of front-running strategy that involves the capture of MEV with large purchase transactions found by searchers in the mempool.

The sequence of events in a sandwich attack unfolds like this:

  1. A user submits a large purchase transaction to the mempool, which once finalized, would raise the price of the asset.
  2. A searcher detects the transaction in the mempool and submits a buy transaction with a higher transaction fee to ensure it gets included before the user’s transaction.
  3. The searcher’s transaction raises the price of the asset, forcing the user to buy the asset at a higher price.
  4. The searcher sells the asset immediately after the user’s buy transaction, profiting from the price change and order of the transaction execution.
This is depicting a large purchase transaction being targeted and rearranged into a block bundle that would profit the block builder. It can be seen as a sandwich with the searcher’s buy/sell transactions as the buns.

MEV in Real Life

Another example of front-running is the Bored Ape Yacht Club MEV extraction situation that unfolded last year. In this scenario, searchers took advantage of the oversight of BAYC holders who left their apes for sale indefinitely. These holders either forgot about the listing or chose not to pay the gas fee to delist, leading to an opportunity for searchers to capitalize. As time went on, the price of apes skyrocketed to hundreds of thousands of dollars and the unsold listed apes remained hidden in the sea of previous listings.

However, once the transaction to remove the listing hit the mempool, searchers were able to detect this and subsequently submitted a transaction with a higher gas fee to front-run the removal transaction. The transaction to remove the listed apes served as a signal to the searchers and resulted in apes being bought significantly under floor price and then sold for a hefty profit.

This is a real example of MEV in action, where you can notice apes being bought well under floor price due to an MEV extraction opportunity with BAYC old listings.

In this case, many Bored Ape holders were caught off guard and were warned to remove their listed apes from being sold, which only enabled the situation as searchers continued to capitalize on this. By the time it was understood that submitting a delisting transaction created an opportunity for searchers, many apes were gone.

Conclusion

The phenomenon of MEV has been a widely overlooked aspect of the blockchain ecosystem, but as it continues to evolve and grow, its helpful for the crypto community to have a deeper understanding of the underlying mechanics that impact our decentralized ecosystem.

MEV is a rapidly evolving area with much to be explored and understood, and not only does it represent a unique opportunity for the creation of value, but has the potential to disrupt the traditional notion of value creation. The future of MEV remains uncertain, but one thing is clear: MEV is here to stay and will reshape the decentralized landscape as we know it.

For more writings like this, please feel free to follow me on LinkedIn.

--

--