MEV

Jun 12, 2023 • 9 Min Read

Key Takeaways

  • MEV or Maximal Extractable Value (MEV) occurs when the block producers in a blockchain (miners or validators) extract value by reordering, including, or excluding transactions within a block.
  • MEV has become highly profitable and widespread on Ethereum in the past few years, with the cumulative amount of MEV extracted on the network exceeding $714M, up from $78M at the start of 2021. MEV bots currently make up a significant portion of the volume on decentralized exchanges.
  • There are many types of MEV, but some of the most common involve sandwich attacks, arbitrage, and front running. Sandwich attacks have become particularly prevalent, with a single Ethereum wallet doing a massive percentage of the volume on Uniswap and generating millions of dollars a month in profit.
  • There are both positives and negatives to MEV. MEV creates an additional form of income for miners and validators but also harms the end users of Ethereum and can pose risks for the network. Regardless, MEV is here to stay and continues to grow.
  • The Ethereum community is working to mitigate the downsides of MEV through MEV protection. MEV protection aims to ensure a fair and transparent transaction ordering mechanism that does not advantage any particular participant over others. Several protocols are working on MEV protection, including Flashbots and Cow Swap.

What is MEV?

MEV or Maximal Extractable Value (MEV) is a topic of crypto that has had a massive uptick in activity and debate in recent years. It occurs when the block producers in a blockchain (miners or validators) extract value by reordering, including, or excluding transactions within a block, often at the expense of users. In other words, block producers can determine the order in which transactions are processed on the blockchain and exploit that power to their advantage. This can be compared to front-running in traditional markets.

MEV has become highly profitable and widespread on Ethereum, with the cumulative amount of MEV extracted on the network exceeding $714M, up from $78M at the start of 2021. MEV bots currently make up a significant portion of the volume on decentralized exchanges. For example, out of the ten top users of Uniswap in the past 30 days, nine of them are MEV bots (with jaredfromsubway.eth taking the #1 spot according to Glassnode).

MEV
Source: Flashbots.net, Fundstrat

Miners can exploit MEV by engaging in various activities, but the most common are sandwich attacks, arbitrage, front-running, and inducing liquidations.

MEV has both positive and negative implications. On the one hand, it can incentivize miners to validate transactions and secure the network. On the other hand, it introduces economic and fairness concerns, allowing certain participants to gain an unfair advantage over others.

Efforts are being made within the Ethereum community to mitigate the negative impacts of MEV. Various protocols and solutions are being developed to minimize MEV extraction and ensure a more fair and transparent transaction ordering mechanism. For example, Flashbots is a research and development organization working on mitigating the adverse effects of current MEV, and its RPC endpoint allows for frontrunning protection and no failed transactions, among other things.

MEV isn’t entirely a bad thing; although lots of MEV is generally viewed as being harmful to blockchain networks and their participants, there are some positives to it as well. It can incentivize miners to operate on the network since there is a monetary incentive, it can contribute to market efficiency and liquidity, it encourages innovation and research, and it also creates a revenue generation opportunity for market participants and protocols.

How MEV Works

On a blockchain network, immutable ledgers are secured by a decentralized network known as block producers. These are the miners in a Proof of Work blockchain and the validators in a Proof of Stake blockchain. Block producers are responsible for aggregating pending transactions into blocks, which are then validated by the network and appended to the global ledger (this is soon to be antiquated by Proposer-Builder Separation). Since each block can only contain a limited number of transactions, block producers have complete autonomy in selecting which pending transactions in the mempool (the location where unconfirmed transactions are stored off-chain) they will include in their block. While block producers, by default, order transactions by the highest gas price to maximize their profits, this is not a requirement. As a result, block producers can extract additional value by taking advantage of their ability to arbitrarily reorder transactions, creating maximal-extractable value (MEV). See below for a high-level illustration of how transactions are ordered, and blocks are produced.

MEV
Source: Fundstrat

Types of MEV

Front-Running

Front-running occurs when a miner or participant in the network takes advantage of their knowledge of pending transactions to execute similar transactions seconds before them. They can benefit from price movements or exploit anticipated market changes by placing their transactions ahead of others. Front-running isn’t unique to crypto and also happens in other forms in traditional markets (where it is illegal). MEV can be compared to Payment for Order Flow (PFOF), which is a form of compensation (usually a fraction of a penny per share) that a brokerage firm receives for directing orders for trade execution to a particular market maker or exchange. Like MEV, PFOF has been criticized for creating potentially unfair or opportunistic conditions at the expense of retail traders or investors.

MEV
Source: Fundstrat

Back-Running

Back-running is the opposite of front-running. In this case, a miner executes transactions after an initial transaction has been submitted but before it is confirmed in a block. MEV bots will generally look for a transaction that will cause a significant dislocation in price due to slippage to execute a back-running transaction. The back-running transaction helps to bring the asset’s price back to parity. Back-running allows them to capitalize on the anticipated effects of the initial transaction.

MEV
Source: Fundstrat

Sandwich Attacks

A sandwich attack is a type of front running that involves strategically buying an asset moments before a pending transaction and then immediately selling that asset after the pending transaction goes through. Essentially, the attacker front-runs and back-runs simultaneously, “sandwiching” the pending transaction in between. By placing these two orders, the attacker is able to manipulate the asset’s prices, causing the user to pay a higher price and then allowing the attacker to sell for a small profit.

Due to the recent rise of low-liquidity meme coins, sandwich attacks have become one of the most prolific MEV attacks. The lower the coin’s liquidity, the more the attacker can move the price, making their sandwich attack more profitable. One of the biggest MEV attack bots, whose Ethereum wallet named jaredfromsubway.eth, has made millions from this attack in the past few months.

MEV
Source: Fundstrat

As seen in the photo below, a user was sandwiched attacked by an MEV bot. As a result, the user paid $46.79 for a token that was trading at $13.49, giving the user only 29% of the tokens he would’ve otherwise received and requiring a 345% return to break even.

MEV
Source: Dexscreener

Arbitrage Opportunities

MEV can also arise from arbitrage opportunities on-chain. These opportunities arise when there are price or liquidity disparities between decentralized exchanges or trading platforms. Miners can profit from these opportunities by executing transactions that exploit these discrepancies.

Miner Ordering Bias:

Miners can determine the order of transactions within a block they are mining. This power can be abused to prioritize or delay certain transactions based on the miner’s own interests. By manipulating the transaction ordering, miners can extract additional value.

Liquidations and Stop Loss Hunting:

In DeFi, liquidations occur when a borrower’s collateral falls below a certain threshold, triggering the liquidation of their position. Miners can front-run or back-run these liquidations to profit from the forced selling or buying of assets. Stop-loss hunting involves triggering stop-loss orders placed by traders to benefit from the resulting market movements.

These are just some of the main types of MEV, but new techniques and strategies can emerge as blockchains and decentralized applications continue to evolve. Despite MEV growing rapidly, efforts are being made to address the negative impacts of MEV and improve fairness and transparency.

The Threat of MEV to Ethereum

While there are positives to MEV, such as earning validators higher rewards, most of MEV is harmful to the end user and the Ethereum network. The most noticeable negative impact is on the everyday user experience on Ethereum. Since MEV-related activities increase network congestion, gas fees are higher for everyone. MEV-related activities also directly impact user transactions on the network. For instance, front-running can result in users paying higher prices or missing out on desirable opportunities due to failed transactions. This can discourage user adoption and hinder the growth of decentralized applications and the overall ecosystem.

Apart from user experience, MEV also introduces risks to the security of the Ethereum network. MEV extraction incentivizes on-chain history re-orgs for extraction of past MEV, as well as incentivizes transaction routing centralization for low latency, privacy, and ordering control. By manipulating transaction ordering, MEV attackers can exploit vulnerabilities, execute malicious transactions, or engage in other disruptive activities that undermine the security of smart contracts, decentralized exchanges, or other applications on the blockchain. These risks can be existential for Ethereum as they undermine the network’s principles of finality and permissionlessness.

Another less talked about threat is potential Ethereum governance challenges and censorship down the road. Addressing the issue of MEV requires careful governance and coordination among the Ethereum community. Implementing effective MEV protection solutions and modifying the protocol to mitigate MEV risks may involve complex decision-making processes and potential disagreements within the community. An example of one of these challenges is Flashbots and other MEV-Boost relays risking censorship on the Ethereum network. The concern of prominent MEV-Boost relays, notably Flashbots, is them explicitly declaring their refusal to incorporate transactions associated with Tornado Cash into the blocks they mine.

This refusal is rooted in the fact that the Office of Foreign Assets Control (OFAC) designated the privacy protocol as a sanctioned entity on August 8. OFAC’s rationale behind this decision was its assertion that Tornado Cash was exclusively exploited by money launderers and cybercriminals from North Korea. While this OFAC claim has some truth to it, it also demonstrates that these MEV-Boost relays may be subject to even more censorship in the future. According to MEV Watch, 31% of Ethereum blocks are currently OFAC compliant.

To tackle these threats, Ethereum developers and the community are actively researching and implementing MEV protection mechanisms and exploring improvements to the protocol. These efforts aim to enhance the fairness, efficiency, and security of the Ethereum blockchain while minimizing the negative impacts of MEV on its ecosystem.

MEV Protection

MEV protection refers to the various techniques and solutions designed to mitigate the negative impacts of MEV. The goal of MEV protection is to ensure a fair and transparent transaction ordering mechanism that does not advantage any particular participant over others.

There are several different approaches to MEV protection, including:

Transaction Privacy:

MEV protection can be achieved by making it harder for attackers to extract value from the transaction data. Techniques such as zero-knowledge proofs can be used to keep transaction details private and prevent front-running or back-running.

Fair Ordering Mechanisms:

Some blockchain networks are exploring alternative transaction ordering mechanisms that reduce the incentives for MEV extraction. For example, the Ethereum network’s EIP-1559 upgrade was implemented in part to create a more predictable and fair gas fee market, reducing the ability of miners to extract additional value.

MEV-Neutral Mining:

MEV-neutral mining is a technique that involves the intentional exclusion of MEV from the mining process. By separating transaction ordering from MEV extraction, miners can focus on securing the network rather than extracting additional profits.

Transparency and Oversight:

Some MEV protection solutions involve increased transparency and oversight to detect and prevent unfair practices. This includes initiatives such as on-chain governance, audits, and real-time monitoring of transactions to identify suspicious activity.

Protocol-level Solutions:

Some blockchain networks are exploring changes to the underlying protocol to reduce the impact of MEV. We discuss a few protocol-level solutions in more detail below.

Flashbots

Flashbots is a decentralized protocol and research and development organization that is working on mitigating the negative externalities of MEV. Fleshpot’s aim is to enable a permissionless, transparent, and fair ecosystem regarding MEV extraction. This falls under three goals: democratizing access to MEV revenue, bringing transparency to MEV activity, and redistributing MEV revenue.

Fleshpot’s RPC endpoint allows for:

  • Frontrunning protection: transactions are not seen by sandwich bots in the public mempool
  • No failed transactions: transactions will only be included if it doesn’t include any reverts, so users don’t pay for failed transactions
  • Etherscan integration: users can see the status of their transactions on Etherscan

Flashbots has gained significant attention and support within the Ethereum community due to its potential to mitigate MEV and improve the overall user experience DeFi. It continues to evolve and develop new solutions to address various challenges in the blockchain space.

Cow Swap

Cow Swap is a Meta DEX (Decentralized Exchange) aggregator that provides MEV protection and integrates with liquidity sources across other DEX’s to offer traders the best prices. It first attempts to settle these orders peer-to-peer directly between two traders without needing an external market maker or liquidity provider, then routes excess order amounts that cannot be settled directly to underlying AMMs. This helps traders avoid the sandwich attacks described above, which cause traders to experience slippage and get a suboptimal price.

Maestro

Maestro is a bot that lets users quickly buy lower liquidity coins while avoiding slippage and MEV. The anti-MEV feature on Maestro has the bot route transactions through a private relay so that buys are not broadcasted on the mempool. This guards against MEV/sandwich bots, but makes the transaction take slightly longer than usual.

Conclusion

MEV is one of the fastest-growing elements of crypto, and it impacts almost every network user. While there are some benefits to MEV, it raises concerns about fairness, transparency, and the potential for market manipulation. Despite these concerns, it’s become clear that MEV isn’t going anywhere. Various research efforts and projects are underway to mitigate the negative impacts of MEV and develop solutions that ensure a more equitable and secure decentralized ecosystem.

Reports you may have missed

Get invaluable analysis of the market and stocks. Cancel at any time. Start Free Trial

Articles Read 1/1

🎁 Unlock 1 extra article by joining our Community!

You are reading the last free article for this month.

Already have an account? Sign In