What is MEV?
Learn about MEV, the mysterious and important issue that brings together the most sophisticated researchers, traders, and protocol designers, and which powers Rook.
A blockchain is built one block at a time. Each block contains a list of transactions in a particular order. The transactions encode a sequence of updates to the blockchain state, sometimes called the world state.
Anyone can broadcast a transaction to the network. Broadcast means that the transaction is public: everyone can see it and inspect it. When you use your wallet to interact with a smart contract or web3 dApp like Uniswap, Compound, or Rook, your wallet is creating and broadcasting a transaction.
Simply broadcasting a transaction doesn't update the blockchain state. Think of it as a request. In order for that request to be carried out, someone must place your transaction in a block, and add that block to the blockchain. How does that happen?

Anyone can listen for transactions being broadcast, and gather them into a list. In order to turn that list into a block, it needs to be validated. Validation creates a mathematical proof that the state changes are consistent: nobody is spending money they don't have, time isn't running backwards, and smart contracts are executed faithfully. The exact details of the validation procedure are different for each blockchain, but they all boil down into an algorithm for turning a list of transactions into a block, which is a list of transactions, along with a mathematical proof of their validity, plus some metadata.
Gathering transactions and turning them into blocks is the work of block producers. In a proof-of-work blockchain, block producers are called miners. In a proof-of-stake system, they are called validators.
By analogy with traditional financial processes, the act of converting a transaction into a block is sometimes referred to as settlement, and the entire apparatus and process of block production, along with all its relevant participants, is sometimes referred to informally as the settlement layer, or the consensus layer.
As the blockchain state evolves, the possibility may arise for transactions that are guaranteed to result in profit. A basic example would be a smart contract with 10 tokens deposited in it, that allows anybody to withdraw those 10 tokens. The first person to create a transaction withdrawing those 10 tokens will profit (by receiving the 10 tokens).
A more common example is an arbitrage opportunity. This results from a difference in prices between the same asset, listed on different decentralized exchanges (DEX). A transaction that makes the right swaps along the right arbitrage route, will end up with more tokens than it started with.
Arbitrage refers to the simultaneous buying and selling of tokens in different markets in order to take advantage of price discrepancies of that asset.
Example of arbitrage transaction on Ethereum:
https://etherscan.io/tx/0x5e1657ef0e9be9bc72efefe59a2528d0d730d478cfc9e6cdd09af9f997bb3ef4
In this example the arbitrageur begins with 1,000 Wrapped Ether (WETH), and ends up with 1,045. Impressive!
These are examples of transactions that have some kind of built-in value. You can say that the transaction in the example above is "worth" 45 WETH, because that is the profit that will go to whoever can first discover and broadcast that transaction, and successfully get it settled, i.e. included in a block that becomes part of the blockchain.
Keepers are automated agents that survey the state of the blockchain and compute all the different possibilities in order to identify transactions that can create this instantaneous profit. Any transaction of this kind can be assigned a value, that is the profit that will result from the transaction being settled.
Once they have identified a valuable transaction, they will broadcast that transaction to the network. It is trivial to analyze the inputs and outputs of a transaction and see how much profit it creates, and hence how valuable it is. So other Keepers will try to copy the original one, and broadcast that same transaction with themselves as the originator (and hence the recipient of any profits).
MEV arises from a simple problem: how can a keeper ensure that they are the one who gets a transaction settled first?
Maximal Extractable Value (MEV), formerly "Miner Extractable Value," refers to profit that can be extracted from a transaction as a result of the need on the part of the transaction originator for priority or control over the ordering of that transaction in a block.
What does that really mean?
Suppose Bob wants to capture that arbitrage that's worth 45 WETH. To ensure his transaction is the first one in the block, he offers to pay 10 WETH to any block producer if they'll put him first. This still leaves Bob with a healthy 35 WETH of profit, and notice that 10 WETH of the original 45 has been transferred to (or extracted by) the block producer, in exchange for ordering rights.
Now suppose that Bob has competition, and Alice decides to offer the block producer 15 WETH, beating Bob's 10. Alice will still get 30 WETH, which is more than the 0 she'd get for coming in second place to Bob!
Bob may counter-bid, and in the limit nearly all of the 45 WETH may end up being bid to the block producer, because any amount is more than the 0 that would be gained for coming in second place. This process of bidding for blockspace results in the transfer of nearly all of the value of these transactions to the block producer.
Notice that it's called Maximal Extractable Value. Whether that MEV is actually extracted depends on competition for the transaction, how it is settled, and so on. Many solutions exist that reduce the amount of MEV that is actually extracted. But because the value of the arbitrage transaction is 45 WETH, and in theory, all 45 WETH could be bid to the block producer, it's common to refer to the whole value of the transaction as MEV. We would say that the arbitrage has 45 WETH of MEV.
To add to the confusion, it's common for the transaction originators, i.e. the keepers, to refer to the profit they get as MEV as well. This is technically correct -- they get to keep the maximum extractable value that is not in fact extracted. Technically correct, but confusing as hell!
While it's hard to quantify the total amount of MEV available on-chain, Flashbots has created a live dashboard displaying how much MEV has been extracted over time. As of May 2021, around $3-4 million of MEV is being captured daily.

Total Extracted MEV - Flashbots MEV Explore v0
Research by Glassnode shows that Ethereum-based DeFi has seen exponential growth over the last several years and shows no signs of abating. As the Ethereum ecosystem continues to grow exponentially, so will the amount of MEV available to be captured on-chain.

Data and graphics by Glassnode
While it seems simple, MEV poses risks not only to the user but also to the consensus layer itself. The reorganisation of blocks, the reordering of transactions, and — even momentarily — the censorship of transactions can have profound impacts on the blockchain and breaks the assumptions of many applications.
Daian et al. originated the concept of MEV and outlined the risks it poses in their seminal paper "Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges".
Read it here: https://arxiv.org/abs/1904.05234
Because block producers are able to prioritize transactions with higher gas fees, a bidding war between bots (who either try to arbitrage or front-run) can occur. This hurts ordinary users and DeFi platforms, because these bidding wars drive up gas fees (Priority Gas Auctions) and cause slippage and failed transactions.
The potential for concentration of MEV in the hands of the largest block producers can lead to runaway growth and concentration of hashpower that harms the decentralization of the network. This was one of the key concerns that led to the formation of Flashbots.
The most common MEV strategies employed by bots are front-running, back-running (a.k.a. tailgating), and sandwiching.
Qin, Zhou, and Gervais develop a MEV taxonomy in their paper "Quantifying Blockchain Extractable Value: How dark is the forest?"
Read it here: https://arxiv.org/abs/2101.05511
At Rook, we take the perspective that the block producer should not be the recipient of any of the MEV in these transactions. Rather, that MEV should accrue to the originator of the transaction, or of the transactions or protocols that create the MEV in the first place.
We support the efforts of groups like Flashbots to ensure that users cannot be exploited or manipulated in MEV strategies, and that MEV cannot be concentrated. But we believe that fundamentally, much of the MEV at the consensus layer is leaking, i.e., it should not be available to begin with.
Using the Rook Protocol, we can capture and recycle this MEV before it can be extracted, ensuring it remains within the economy and drives a more efficient market overall.
Last modified 1yr ago