What is MEV and how it endangers Ethereum

Ethereum’s smart contracts enabled the birth of DeFi and forever changed the landscape of retail investing. This naturally has drawn a lot of negative attention from the TradFi sector, with the SEC leading the charge against the highly-valuable blockchain network. But Ethereum’s biggest threat may come from within due to the novel risks posed by MEV.

Before I go into what MEV is and how it works, it’ll help to quickly recap how transactions on Ethereum are finalized. When users interact with the Ethereum network, their transactions go into something called a mempool, which is essentially a public database of pending transactions. After that, validators (earlier miners) pick transactions from the mempool and include them in blocks (building), which they then send out to other validators for consensus (proposing).

In return for their work, these keepers of consensus receive a share of the tips from total transaction fees as well as a block reward in form of newly issued ETH. In addition to these, there is another avenue validators have for earning money, and that is MEV.

MEV is the total value that can be extracted from block production in excess of the standard block reward and gas fee share through the manipulation of transactions. This usually happens in the form of including, excluding and re-ordering transactions within the block, or through generalized frontrunning.

MEV initially stood for Miner Extractable Value, but since the merge switched Ethereum to proof of stake and replaced miners with validators, the acronym now stands for Maximal Extractable Value.

It’s important to note here that it’s not just validators who make profits from capitalising on MEV.

source: MEV-Explore v1
source: MEV-Explore v1

In fact, a considerable share of it is extracted by independent network users called searchers, who use algorithms to actively scour the mempool and the dark forest of Ethereum for profitable MEV opportunities and then use bots to capitalize on them. If you’re confused about what exactly this means, here are a few examples to clear things up.

Ways to capture MEV

Front-running

One of the first forms of MEV extraction, front-running involves searchers using generalized front-runner bots to scan the mempool for profitable transactions, then submitting the same transaction with a higher gas price so that it gets picked first by the validator.

DEX arbitrage

This is the most common form of MEV and its possible due to the fact that tokens often have slightly different prices across Decentralized Exhanges (DEXs) on the same chain due to varying demand. So if ETH is priced at $1400 on Uniswap but at $1405 on Curve, a searcher could swap large amounts of USDC for ETH on the former and swap it back on the latter to make an easy profit.

Liquidation

Lending protocols like Aave and Maker provide peer-to-peer loans which are over-collateralized to offset risk. If the value of a loan’s collateral drops below a certain threshold due to market fluctuations, these protocols allow anyone to liquidate the collateral in order to pay off the lenders, and earn a liquidation fee for doing so. Searchers are always competing with each other to be the first to submit a liquidation transaction and collect the fee.

Sandwich attacks

Several DEXs like Curve, Uniswap and SushiSwap use automated market makers to price asset pairs in their liquidity pools. For LPs with low liquidity, large trades can cause drastic price fluctuations (slippage) due to the change in the assets’ scarcity.

A sandwich attack capitalizes on such transactions by both front-running and back-running the trade. Let’s take an example. A user places an order to buy 1000 ETH worth of GNO from a low liquidity GNO/ETH pool on SushiSwap. If a searcher’s MEV bot spots this pending transaction in the mempool, it would buy GNO before the user, then sell it immediately after the user’s transaction to profit. This is how it would happen:

  • Txn 1: MEV bot swaps a little ETH for GNO in the LP, pushing the GNO price up slightly

  • Txn 2: User swaps a lot of ETH for a lot of GNO, driving the ETH price way down and the GNO price way up

  • Txn 3: MEV bot swaps its GNO for more ETH than it initially bought, profiting from the price difference

NFT MEV

The relatively recent growth of the NFT space has led to searchers applying MEV strategies traditionally used in DeFi. This happens in the form of paying more gas to cut the line and mint an NFT before the supply runs out, or in the form of beating other searchers in the race to buy a valuable NFT listed for a lower-than-expected price.

MEV and the risks of centralization

One thing you might have noticed in most of these examples is that searchers aren’t competing against regular users as much as they are against each other. And to win these fights, they need to incentivize validators to pick their transactions over those of their rivals. How do they do this? By paying high (sometimes exorbitant) gas fees.

Logically speaking, an economically rational searcher would be willing to pay a gas fee amounting to less than 100% of the MEV they stand to extract (any more and they incur a loss). This leads to searchers paying up to 90% of their MEV to be the first to capitalize on a highly-competitive opportunity like a DEX arbitrage or a liquidation.

The risk of centralization here arises from validators wanting to make more money. Since validators don’t perform computationally intensive work like miners did, they earn far less ETH in block rewards, making them more likely to seek out MEV opportunities.

source: Unsplash (regularguy.eth)
source: Unsplash (regularguy.eth)

Another issue stems from Ethereum requiring users to stake 32 ETH to become validators. This has led to the formation of numerous staking pools running multiple validators. These pools have amassed large amounts of resources which they can deploy to improve their MEV-extraction capability. Since solo stakers can’t really compete against these large staking pools when it comes to capturing MEV, they are likely to join these pools to bolster their revenue, thereby reducing Ethereum’s decentralization.

All unethical MEV opportunities arise from the fact that the mempool is public, that is, anyone can see all of Ethereum’s pending transactions. But what if you could bypass it? That would be extremely useful not only for regular users looking to avoid getting frontrun, but also for searchers who want to avoid competition from other searchers.

The easiest way to go about this would be to send transactions directly to a validator, who would then include the transactions in their block in exchange for a fee. This practice is already gaining steam and leading to the creation of permissioned, access-only mempools, which are anathema to Ethereum’s permissionless and trustless nature.

The Ethereum network is well aware of the existential threat it faces from MEV and has been researching into making sure that post-merge Ethereum holds true to the blockchain’s core tenets.

Is MEV just all bad?

You might be forgiven for thinking that MEV is a totally negative force with no redeeming factors. But that’s not exactly the case.

Yes, it’s true that MEV poses a bunch of quite serious threats to Ethereum. In addition to the risks of centralization we just covered, some forms of MEV like sandwich attacks result in terrible experiences for users on DeFi protocols.

Then you have numerous searchers vying to be first in line by paying higher and higher gas prices, which results in a congested network and high gas fees for regular users doing regular transactions. Finally, if a block’s MEV is significantly than the block reward itself, it might spur validators to re-organize blocks in an attempt to capture the MEV for themselves. This would lead to blockchain re-orgs and general consensus instability.

source: TimesNext
source: TimesNext

But MEV is not all bad.

DeFi protocols like DEXs and lending platforms actually rely on MEV to function efficiently.

The practice of DEX arbitrage, for example, makes sure that asset prices remain stable and accurate. Lending protocols meanwhile rely on searches liquidating under-collateralized loans to ensure that lenders are paid back quickly.

However, the bad clearly outweighs the good when it comes to MEV. And it’s clear that this issue is a serious one that needs to be solved if Ethereum aims to be a trustworthy network that can endure the trials of time.

There are entities working on mitigating the negative impact of MEV. Ethereum’s two main proposed solutions — Proposer Builder Separation (PBS) and Builder API — are being implemented in the form of MEV-Boost by Flashbots, which preserves the network’s decentralization while increasing validator revenue.

Subscribe to RoverX
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.