How to protect Ethereum investments from MEV-induced losses

Understand the role of Flashbots and MEV in DeFi. Discover why these concepts are crucial for DeFi users.
Understand the role of Flashbots and MEV in DeFi. Discover why these concepts are crucial for DeFi users.

Overview

This article provides an introduction to the issue of maximum extractable value (MEV). It discusses how MEV has shaped the infrastructure of the Ethereum network and how investors can protect themselves from the suboptimal execution of their trades due to MEV.

Key Insights

  • For users of DeFi applications, maximum extractable value (MEV) acts as an invisible fee that is not included in the gas price of a transaction. It can result in the suboptimal execution of trades — i.e., is one of the contributors to slippage. This hidden fee goes partially to so-called searchers who look for MEV opportunities and partially to validators. In the period since the Merge of the Beacon Chain with the Ethereum mainnet, 64% of MEV went to searchers and 36% to validators.
  • Under normal market conditions, MEV-boost payments to validators make up 10% of their total revenue. However, during big market swings and high volume events, MEV extracted from users even outpaces the high gas prices during these periods. In the FTX collapse in November 2022, MEV made up over 60% of validators’ revenues. When USDC depegged, it was 66%. It is particularly during such adverse market events that DeFi investors are vulnerable.
  • According to a 2022 study, 51% of MEV could be attributed to arbitrage, whereas liquidations and sandwich attacks came in at 16% and 32%, respectively.‍

Definition

Maximum extractable value (MEV) is an umbrella term for earnings that can be harvested from the users of a blockchain ecosystem by changing the ordering of transactions within a block or by inserting new transactions purposefully into it. This ability to organize the movement of funds within a block is exclusive to miners (on a PoW chain) or validators (on a PoS chain). Because Ethereum, the blockchain on which MEV is a much-discussed phenomenon, was PoW until September 2022, the acronym MEV originally stood for Miner Extractable Value. As validators took the role of miners, it was recast to Maximum Extractable Value. 

MEV exists entirely because most blockchain networks offer no fair, reliable mechanism for determining if one transaction was submitted earlier than the other. It is only once a block has been mined, broadcast and confirmed that the ordering of transactions within it is fixed. The miner or validator who creates a block therefore has the exclusive freedom to select and arrange transactions from the mempool in whatever way they desire.

To most, it is not immediately obvious how MEV as explained here could present a danger to users. In a payment system that only handles simple transactions in one currency, the power to determine their order is of little use. Account balances are not sensitive to the exact sequence in which transfers of funds appear on the blockchain.

However, smart contract platforms such as Ethereum are considerably more complex than a system that only handles money transfers in a single currency. They inscribe many different tokens and implement automated market makers, loans, derivatives and other complex financial instruments. These instruments are highly time-sensitive and open to manipulation, just like on traditional markets. They can thus be manipulated by those who have the ability to compose blocks.

Types of MEV

Although the term MEV is only used in relation to blockchain platforms, the most important types of MEV are phenomena known from traditional finance, namely arbitrage, sandwich trades and liquidations. However, there are also more complex, niche MEV opportunities that fall outside of this classification. 

Arbitrage

Arbitrage refers to any economic opportunity created by price differences between different markets — decentralized exchanges (DEXs) in the present context. The principle behind this is simple. If one wrapped Ethereum (wETH) trades for 1630 USDT on Uniswap, but only for 1598 USDT on SushiSwap, a validator can insert two transactions into a block that can exploit this price difference to make a profit. 

For example, a large amount of wETH is bought on SushiSwap and then immediately sold for a higher price on UniSwap. Because the validator does not broadcast these transactions to other validators, there is no risk that only one of the steps is executed or that prices have changed in the meantime. The transactions will only ever appear in the exact context and sequence in which they have the desired consequence. Using Flash Loans, such an arbitrage trade may even be executed without providing any up front capital.

In terms of overall MEV volume, arbitrage is by far the dominant type, coming in at 50%. However, in the absence of any forms of price manipulation to create this arbitrage, this form of MEV is seen as unproblematic. If price differences between DEXs were not absorbed at block creation as MEV, they would become opportunities for regular arbitrage traders. Therefore, there is no impact on ordinary user experience.

Liquidations

The second largest type of MEV by volume with 25% are liquidations. In DeFi, it is most often the collateral for loans that is subject to liquidation. When the collateral depreciates significantly in value, there is a risk it will no longer sufficiently back the loaned asset. At a certain threshold, a liquidation is triggered and the collateral is sold lest its value drops further. The borrower also has to pay a hefty liquidation fee. Unlike on a centralized platform, however, in DeFi this liquidation cannot happen automatically. This is because smart contracts do not keep running in the background and monitor for price changes. Every action by a smart contract needs to be explicitly invoked through a function call made by a user. In principle any user can trigger a liquidation of a loan and receive the associated reward for it. However, as validators decide which transactions go into the block, they are in a unique position to collect these fees. Liquidations have therefore become a type of MEV. Much like arbitrage, liquidations are seen as unproblematic, unless they are the result of manipulated price movements. In fact they are even necessary for the proper functioning of lending protocols and DeFi has a whole.

Sandwich trades

Unlike arbitrage and liquidations, sandwich trades always result in worse execution prices for users. They are therefore considered harmful and unethical by many. A sandwich trade works by first front-running a large buy or sell order and then taking profit from its price impact with a second transaction that is executed right after the order. For example, if someone bought 500,000 Wrapped Ether (wETH) in a single transaction with a price impact of 2%, a validator could sandwich this buy order between a buy and sell order of their own. They could buy wETH and sell it in the same block and generate an essentially risk-free yield of about 2%. Of course, this comes at the cost of the large buyer, who gets a worse execution price. Given that decentralized finance (DeFi) transactions are often routed through multiple hops, the slippage caused by sandwich trades can accumulate. After the depegging of USDC in 2023, this led to a famous case of a trader receiving $0.05 USDT in exchange for $2M USDC.

MEV threat to Ethereum infrastructure

The incentives provided by MEV have shaped the infrastructure of the Ethereum ecosystem and the process of how blocks are created and submitted. This section will outline the risk of centralization that MEV would introduce to Ethereum’s base infrastructure. It then moves on to Flashbots, the solution the community has created to alleviate these woes. 

Ethereum’s base network offers only a public mempool. This mempool is a repository that users submit their transactions to and that validators draw on for the creation of blocks. In this default setup, searching for MEV opportunities would not be attractive for non-validators. This is because generalized front-runners monitor the mempool for profitable, MEV yielding transactions and re-submit analogous transactions with a higher fee themselves to try to steal the MEV opportunity. With Ethereum’s base infrastructure, only validators can search for MEV opportunities without the risk of being easily front-run.

The base infrastructure would thus not only keep profits from MEV to a small minority, but also incentivize the centralization of the network. The coincidence of block search and validation would give corporate entities a competitive advantage. They could deploy more sophisticated algorithms that can extract MEV more efficiently. Higher profit margins would then allow them to gain and attract more capital and reduce the share of other validators. This would kick off a feedback loop, because a higher stake in the network in turn makes the MEV search more profitable, as more of the identified opportunities can be exploited. Thus, the Ethereum network’s proof-of-stake (PoS) consensus would become gradually more centralized.

Flashbots as a hedge against centralization

The research organization Flashbots contributes to mitigating centralization by democratizing MEV search and separating it from block creation. Independently of Ethereum’s main developers, they created a network of transaction relays that lets MEV searchers bypass Ethereum’s main mempool with a private MEV mempool. This is done through so-called MEV-relays that take ordered bundles of transactions created by searchers and run a sealed-bid auction for them among validators. The result has been a fair marketplace that has avoided the monopolization of MEV revenue.

It has also increased transparency with respect to MEV activity because the Flashbots project publishes information about the amount of MEV extracted from Ethereum users. At the time of writing 90% of Ethereum validators use MEV-boost relays to receive bundled transactions. There are currently 11 such relays that redistribute blocks from 30 different so-called builders. Some of these entities engage in the censorship of transactions and only include Office of Foreign Assets Control-compliant transactions. The figures below show the percentage of blocks routed through the largest relays and builders respectively.

Potential and risk for network users

The revenues that validators and searchers generate from MEV are extracted from users of DeFi applications. The following chart shows the composition of validators’ rewards from MEV boosts and regular gas fees. The MEV payments to block proposers are not included.

The chart shows that in normal market conditions, MEV-boost payments to validators make up only about 10% of their total revenue. However, during big market swings and high-volume events, the MEV extracted from users outpaces even the high gas prices during these periods. This means investors in the DeFi ecosystem are especially vulnerable to incurring additional losses during these periods.

The two spikes show the FTX collapse in 2022 and the depegging of USD Coin (USDC) on March 11, 2023. On both occasions, over 60% of validators’ revenues were from MEV. This can be attributed to a high number of liquidations on those days but also to a large number of trades with high volumes that are at risk of being sandwiched. Especially large transactions that have a large price impact on some of the liquidity pools that route them are at risk of this. As mentioned in the section on sandwich trades, the USDC depegging event famously resulted in a trader receiving 0.05 USDT for 2M USDC after forgetting to set the maximum slippage.

As an investor in the DeFi ecosystem, it is essential to be aware of tools that can help prevent being front-run in this way. Those with large transactions who want to avoid front-running attacks can connect to the alternative remote procedure call (RPC) endpoints of block builders instead of the standard Ethereum mainnet RPC nodes that most Ethereum wallets will use by default. Some providers will offer to submit transactions through their own relays and guarantee that they will not be front-run or sandwiched.

Conclusion

The ability of miners and validators to reorder transactions is a major weakness of current blockchain networks. It gives validators on smart contract blockchains the ability to extract additional rents from users of the network that go beyond the nominal transaction fee. As an investor in the DeFi ecosystem on Ethereum, it is advisable to take risks to mitigate being front-run or sandwiched, especially during adverse market events.

This article is for information purposes only and represents neither investment advice nor an investment analysis or an invitation to buy or sell financial instruments. Specifically, this document does not serve as a substitute for individual investment or other advice.

References

Qin, Kaihua, Liyi Zhou, and Arthur Gervais. “Quantifying Blockchain Extractable Value: How Dark Is the Forest?” In 2022 IEEE Symposium on Security and Privacy (SP), 198–214. IEEE, 2022.

This article is for information purposes only and represents neither investment advice nor an investment analysis or an invitation to buy or sell financial instruments. Specifically, this document does not serve as a substitute for individual investment or other advice.