The term MEV was initially proposed by Phil Daian in "Flash Boys 2.0," and it has since been popularized by Dan Robinson, Georgios Konstantopoulos, and Samczsun in "Ethereum is a Dark Forest" and "Escaping the Dark Forest". MEV has become a key idea in crypto-economics, but one might ask, what exactly is MEV?
By definition, the different forms of value that can be derived from transaction ordering by whoever is producing the block in the Ethereum network is termed as Miner Extractable Value or Maximum Extractable value (MEV). MEV is being considered one of the biggest threats to Ethereum right now. In this article, we will talk about the fundamentals of MEV and how it creates centralization of power, and in the following article of this series, we will dig down the rabbit hole to see what is going on in the Dark Forest.
The name might hint that MEV is mostly extruded by miners because the miner is the only person who can ensure the execution of a successful MEV opportunity. In reality, however, a significant portion of MEV is recovered by independent network users known as "searchers." Searchers execute complicated algorithms on blockchain data to find potential MEV chances and use bots to submit those transactions to the network. Miners do receive a share of the total MEV value because searchers are prepared to pay large gas prices (which go to the miner) in return for a higher possibility of their transactions being included in a block.
Before going into the details of MEV, Let’s take a look at common forms of MEV that are taking place on the EVM compatible Blockchains.
Decentralized Exchange (DEX) Arbitrage is the basic and well-known type of MEV. As a result, it also has the highest level of competition. It works as follows: if two DEXs offer the same token at different prices, someone can purchase the token on the lower-priced DEX and sell it on the higher-priced DEX in a single atomic transaction. This is actual, risk-free arbitrage, thanks to the blockchain's mechanics.
Liquidations are somewhat similar to margin calls in traditional finance. When you apply for a loan, the bank wants collateral for the loan and the worth of the collateral is more than the loan. You sign a contract with the bank if the worth of the collateral ever drops to 120%(variable can be different) of the price of loan you have taken then the bank has the right to sell your collateral for the compensation of the loan. Let’s say you took a $100,000 loan from the bank and provided $150,000 collateral (any asset) and signed a contract with the bank that if the price of the asset ever drops to $120,000, they can sell the asset to compensate for the loan.
And here in the crypto space, the lending protocols allow anyone to liquidate the loans and get a % of the liquidated loan fee. So, it is an MEV opportunity for the searchers. Here is a video explaining how the liquidation MEV is captured“Flashbots: Finding & Capturing MEV 101”.
NFT MEV is buying new famous NFTs at the floor price and selling them to the ones who come after you. You make money by being fast, smart and early in the crypto space, and everyone pays for it. And here is an example of a person being fast, smart, and early when buying the crypto punks at the floor price. This is one of the simple examples (relatively), searchers are also working on getting the rare NFT by sending two transactions in one bundle (one minting the NFT and the other checking if the NFT is required one or not). If one of them fails, the whole tx bundle will revert. It’s like getting what you want or don’t play the dice.
A sandwich attack is where the attacker makes a profit from the slippage the user provides for its big order to get executed. Let’s say you place a big order for purchasing WETH for DAI. This order goes to mempool (where all the pending transactions are visible), a bot detects the transaction and Front-Runs the victim by acquiring WETH before the victim buys it. This boosts the WETH price for the victim trader and causes slippage (Expected price increase or price decrease based on the volume to be traded and the available liquidity) and then executes a selling order right after the big order gets executed to sell the token for a profit. But sandwich attacks are risky because these are not atomic swaps, meaning the attack takes place in two separate transactions.
As miners are the ones who randomly exclude, include and reorder transactions in any block that they're able to mine, giving miners the authority to execute transactions however they seem fit is pushing the Ethereum protocol towards centralization where miners will always have the last word. If a miner wishes, he could reorder the transaction, insert his transaction, censor other arbitrager transactions to get the most out of the opportunity found by the searcher. MEV plays a significant role on DEXs like UNISWAP or even lending platforms like AAVE in the form of flashloan arbitrage and liquidations. On Ethereum, transaction ordering is important, especially for traders on DEXs and DEFI protocols. The reason for this is that sometimes executing a move first, even milliseconds ahead of another trader, is all that matters and all that stands between winning or losing the bidding war. Miners can receive greater rewards from these sorts of Ethereum users, who prioritize the speed and order in which their transactions are performed on the blockchain than the ordinary user. MEV may soon exceed the regular Ethereum block reward as DeFi gains popularity. As a result, the likelihood of selfish block mining and consensus instability is at stake. Let’s look at an example to help you understand how miners can manipulate mempool and transaction mining.
An arbitrage bot notices an opportunity and submits a transaction to capture it offering a transaction fee to the miner. In this case, one of two things may happen:
This bidding war is called a priority gas auction (PGAs) but if the miner does not try to capture it then as we mentioned a PGA is kicked off. The difference between the price at which the auction settles and the total MEV available is the winning trader's profit but because of this bidding war, Ethereum normal users are hurt the most because these miners are incentivized to reorder transactions to get the arbitrage capital percentage and increases the fees on Ethereum by a large amount making the main chain way too expensive for normal users.
The fact that most miners are not seeking to exploit MEV is a distinguishing aspect of Ethereum's present age. Searchers are driving nearly all of the present activity. On the other hand, some MEV can only be seized by miners, who have the right to unilaterally arrange (or exclude) transactions. Searchers have access to a relatively smaller subset of "simple" MEV; "complicated" preferences cannot be stated efficiently using PGA's.
In this article we discussed, what is MEV, who are exploiting this loophole, what are the types of MEV, and how miners are using their power to create centralization of MEV extraction. Flashbots is an organization backed by Paradigm , working on the democratization of MEV Extraction and more on it in the next article.
Also Read: Uniswap v3: Power To Liquidity Providers