Hashtag Web3 Logo

Hashtag Web3 / Updated

What is MEV? The Invisible Tax on Web3 Explained

Maximal Extractable Value (MEV) is one of the most powerful and complex forces in crypto. Learn what it is, how it works, and its impact on the Web3 ecosystem.

What is MEV? The Invisible Tax on Web3 Explained - Hashtag Web3 article cover

What is MEV? The Invisible Tax on Web3 Explained

Maximal Extractable Value (MEV) has gained significance in cryptocurrency and decentralized finance (DeFi). It represents the maximum value that can be extracted from block production beyond the standard block reward and gas fees by including, excluding, or rearranging transactions within a block. Although technical, MEV profoundly impacts the fairness, security, and efficiency of blockchain networks. Users often experience worse prices on trades without realizing it, leading to the term "invisible tax." This article explains MEV, its mechanisms, various forms, and its relevance for every Web3 user.

The Mempool and the Role of Block Producers

Understanding MEV requires knowledge of transaction processing. When you submit a transaction on a blockchain like Ethereum (for instance, swapping tokens on Uniswap), it first enters the mempool. This area contains pending, unconfirmed transactions waiting for selection by a block producer, either a miner in Proof-of-Work systems or a validator in Proof-of-Stake systems.

Block producers choose transactions from the mempool to assemble the next block. Their incentive lies in selecting transactions with the highest gas fees, but they also have the discretion to choose which transactions to include and their order. This ability to reorder transactions provides a pathway for MEV extraction. A rational block producer will prioritize transactions that maximize their profit, leading to MEV opportunities.

Anatomy of an MEV Opportunity: Sandwich Attacks

Sandwich attacks exemplify a common form of MEV. This front-running tactic targets users executing large trades on decentralized exchanges (DEXs).

Here’s a detailed process of a sandwich attack:

  1. The Bait: A user submits a large purchase order for Token Y using Token X on a DEX like Uniswap.
  2. The Searcher: Bots, known as "MEV searchers," monitor the mempool for opportunities. A searcher bot identifies the user's large buy order.
  3. The Front-run: The searcher bot submits a transaction to buy Token Y with a slightly higher gas fee than the user's transaction, ensuring its priority in execution. This action raises Token Y's price slightly due to the automated market maker (AMM) mechanics.
  4. The User's Trade: The user’s transaction executes at a worse price than expected, resulting in slippage.
  5. The Back-run: The searcher bot quickly submits another transaction to sell the Token Y purchased earlier. The price, now improve by the user’s trade, allows the searcher to sell for a profit. This transaction has a lower gas fee to ensure it executes after the user’s trade.

In this scenario, the user’s trade is "sandwiched" between the searcher's buy and sell orders. The searcher secures a risk-free profit, while the user faces a disadvantage in execution price. This profit embodies the Maximal Extractable Value.

Other Forms of MEV

MEV manifests in various forms beyond sandwich attacks:

MEV Type Description Impact
DEX Arbitrage If a token's price differs between two DEXs (e.g., Uniswap vs. Sushiswap), a searcher can buy low on one and sell high on another in a single transaction. Generally beneficial; promotes price consistency.
Liquidations In DeFi lending platforms like Aave or Compound, if collateral value dips below a threshold, positions can be liquidated. Searchers aim to trigger these liquidations first for bonuses. Helps maintain protocol solvency.
NFT MEV During NFT mints, transaction ordering can be advantageous. A searcher may attempt to mint a rare NFT ahead of others or sandwich a user accepting a high bid on an NFT marketplace. Can create unfair advantages in NFT markets.

The MEV Supply Chain: Searchers, Builders, and Proposers

The MEV ecosystem consists of three key participants:

  1. Searchers: Operators of bots that continuously scan the mempool for profitable MEV opportunities. They create "bundles" of transactions that must be executed in a specific order to yield profit.
  2. Builders: Specialized entities that construct the most profitable block possible using bundles from multiple searchers. They use algorithms to identify the best combination of bundles and regular transactions.
  3. Proposers (Validators): The chosen validator for the next block does not need to construct the block themselves. With Proposer-Builder Separation (PBS), they can auction their block space to the highest bidding builder. The builder that constructs the most profitable block will pay the highest bid to the proposer.

This arrangement, enabled by infrastructure like Flashbots, seeks to democratize MEV and prevent "gas wars," where searchers escalate gas fees to gain transaction inclusion. It encourages a more orderly and efficient private market for MEV extraction.

MEV: A Double-Edged Sword

The discussion surrounding MEV is complex. On one hand, it poses as a predatory "invisible tax" on users. Sandwich attacks and front-running diminish the experience for everyday users and create perceptions of a manipulated system.

Conversely, some forms of MEV are important for market efficiency. DEX arbitrage enforces price uniformity across the DeFi ecosystem. Liquidations are essential for ensuring the solvency of lending protocols.

Current consensus acknowledges MEV as an unavoidable aspect of transparent blockchain systems. The focus has shifted from eliminating MEV to managing its adverse effects. Initiatives like Flashbots aim to enhance transparency in the MEV process and minimize network congestion resulting from MEV-related gas wars. Other solutions include developing dApps that mitigate MEV susceptibility, such as implementing frequent batch auctions or encrypted mempools.

Managing the MEV Impact

Understanding MEV equips developers and users to make informed decisions. While completely avoiding MEV may not be feasible, various strategies can help mitigate its effects:

  • Use tools that offer MEV protection.
  • Set lower slippage tolerances when trading.
  • Employ private transaction relays to shield trades from potential front-running.

As the blockchain ecosystem matures, strategies for managing and minimizing the "invisible tax" of MEV will evolve.