Site iconSite icon ForkLog

The Invisible Tax on Ethereum: What MEV Is and How to Counter It

The Invisible Tax on Ethereum: What MEV Is and How to Counter It

The cryptocurrency market is growing exponentially — its total market capitalization has surpassed $2 trillion. Since the start of the year, this figure has risen by 180% (on 180%).

The decentralised finance (DeFi) segment is equally impressive. Its TVL stands at $181 billion, up from the start of the year by over 500% (over 500%).

The popularity of smart-contract-based applications is opening avenues for extra income, relying on market inefficiencies, the quirks of Ethereum and other blockchain architectures, and the widespread use of automated market makers in DeFi with their inherent slippage and impermanent losses.

One such avenue is Miner Extractable Value (MEV). It is the profit a miner can earn by including, excluding, or changing the order of transactions in the blocks they produce.

ForkLog has examined the features of MEV and the reasons for its rising popularity. We have identified the available MEV extraction strategies and the solutions aimed at minimising the negative effects associated with it.

  • Against the backdrop of rapid DeFi growth, MEV has emerged as a relatively new risk for users. It is not only about the high fees that users pay—the so‑called invisible tax—but also about potential consensus sabotage by miners competing for extra profits.
  • Many projects are building tools to mitigate MEV-related downsides, including execution of trades at suboptimal exchange rates.
  • Effective countermeasures may include Layer 2 scaling solutions and the launch of Ethereum 2.0 with a fundamentally different consensus mechanism.

The MEV Concept

Bitcoin and Ethereum blockchains are immutable ledgers protected by a decentralised network of computers, known as miners.

Miners constantly aggregate transactions into blocks that are sequentially linked. Although blockchains guarantee transaction validity (for example, preventing double-spend), it is not mandatory that the transactions within a block appear in the same order as they were broadcast to the network.

Ethereum miners typically prioritise transactions by gas price to maximise fee income. Yet this is not a network requirement; miners can monetize additional revenue by rearranging the order of transactions. This is how Miner Extractable Value is extracted.

Before a transaction is included in an Ethereum block, it first enters a publicly visible mempool — a large set of transactions awaiting confirmation by the network.

Flow of transactions from users to blocks. Data: ForkLog.

In this mempool, MEV bots search for opportunities to earn income, for example through arbitrage trades or from liquidating undercollateralised loans.

MEV-bot revenue by operation type (arbitrage dominates; liquidations account for just over 3%). Data: Flashbots.

Suppose an arbitrage opportunity worth $10,000 appears on Uniswap as a price slippage after a large trade. An arbitrage bot spots it and sends a transaction to capture the profit. The proposed miner fee is $10.

Significant MEV activity is conducted using Uniswap v2. Data: Flashbots.

As Paradigm Research experts explain, two scenarios can unfold:

The $10,000 potential profit is MEV. If the miner doesn’t capture it, the PGA for the subsequent arbitrage opportunity begins, and the gap between the auction’s closing price and MEV yields the winner’s profit. For example, if the miner’s fee is $4,000, the remaining $6,000 is the trader’s profit.

That is a broad-brush MEV example; the full picture is far more complex. The MEV concept was first proposed by Phil Daian in his 2019 paper “Flash Boys 2.0: Front-Running, Transaction Reordering and Instability in Decentralised Exchanges” and popularised by Dan Robinson, Georgios Konstantopoulos, and samczsun in articles “Ethereum Is a Dark Forest” and “Escaping the Dark Forest”.

There are many MEV strategies. All require clear transaction ordering — placing them before and/or immediately after large orders on decentralised exchanges.

Let us consider the main MEV-strategy types:

  1. Front-running — the process of inserting a new transaction into the execution queue just before the original transaction. For example, a trader places a large ETH trade on a DEX. The operation is sizeable enough to push the ETH price higher. Detecting a pending transaction in the mempool, a bot can capture profit: buy ETH at a low price just before a large purchase occurs, then sell when the price rises.
  2. Back-running — the bot submits a transaction A to the network with a slightly lower gas price than the pending transaction B, so A completes just after B in the same block. For liquidation strategies, bots place transactions immediately after price oracle updates to beat rivals. Or a sell order is executed immediately after a surge triggered by a preceding large buy.
  3. “Sandwich” — a combination of front-running and back-running. Suppose a large buy order is detected in the mempool; the bot posts a front-running order to buy tokens at a lower price, then the large order moves the price up, and the bot sells at a profit before others.
  4. Uncle-bandit. A relatively new type of attack: a bot executes a “sandwich” operation based on data found in an uncle block, which effectively serves as a mempool.

In the latter strategy, miners have a clear advantage over other market participants since they can identify uncle blocks first.

The most common MEV activities involve one or more decentralised exchanges. Arbitrage opportunities arise when asset prices differ across venues, often due to low liquidity or large trades that briefly move the price.

Arbitrageurs buy the asset on the cheaper venue and sell on the pricier one, helping restore pricing to equilibrium. Such activity can occur also between DEXes and centralised exchanges.

ForkLog asked for comment from an MEV expert who preferred to remain anonymous (we will call him Konstantin Nikiforov for convenience).

“There are several types of arbitrage operations. The first technique — probably the most popular — is “sandwiching.” When one transaction is placed above, i.e., before, a large transaction. And the next transaction must sit as close to it as possible,” — Nikiforov explained.

Drawing a parallel with traditional markets, front-running and arbitrage are not new phenomena. Methods developed over decades describe how trading firms use high-speed software to gain advantage, as recounted in Michael Lewis’s book “Flash Boys: High-Frequency Trading on Wall Street”, published in 2014.

Back-running in traditional markets is usually linked to mechanisms that allow trading firms to execute orders immediately after certain events.

Dark pools also exist on traditional markets, long established but not accessible to ordinary investors. Buyers and sellers on such venues can place orders without revealing them to the wider public.

“MEV is, in one form or another, business. In a sense, it is akin to high-frequency trading—a kind of pseudo-HFT. It’s about moving fast, but not at the pace of traditional centralised venues where your aim is to win by nanoseconds,” Nikiforov shared.

Because MEV involves not only miners but other market participants, it is increasingly described as Maximum Extractable Value.

Rising MEV Popularity

According to MEV-Explore, since 2020 market participants have extracted MEV worth more than $700 million.

Measured MEV at cumulative total (from 01.01.2020) and its daily dynamics. Data: Flashbots.

A natural question is: how large can MEV profits be? Nikiforov notes that profits can run into millions of dollars.

“On Flashbots.net there is a section listing sums earned by arbitrageurs beyond ordinary yields. There have been operations worth a million dollars. My maximum deal was around $50,000,” Nikiforov said.

The screenshot below shows a list of the largest MEV operations across various fee tiers.

Data: Flashbots.

The MEV boom, nicknamed the “invisible tax,” has spurred miners to deploy their own bots.

In March 2021, the Ethermine Ethereum pool run by Austrian outfit BitFly introduced MEV-arbitrage strategy designed to compensate miners for revenue losses after the London hard fork’s EIP-1559 activation. Around 80% of the extracted profits are distributed among pool participants.

Others soon followed. For example, the 2Miners pool announced MEV tooling via ArcherDAO. Around the same time, Flexpool indicated beta MEV-tools testing announcements.

Independent analysts note that by April 2021 as much as 30% of Ethereum blocks contained MEV-related transactions. By now, a substantial portion of top-10 mining pools and large solo miners are using various MEV solutions, including the popular MEV-Geth flash bot.

Invisible Tax and Potential Harm to the Ethereum Ecosystem

As DeFi grows in popularity, arbitrage opportunities widen and tools for carrying out such operations proliferate. Consequently, competition among arbitrage bots intensifies, amplifying the PGA — the “gas wars.”

While MEV can contribute to price alignment and market efficiency, the side effect of a “winner takes all” contest is higher transaction costs for all participants. The fees paid by bots, often a substantial portion of the total arbitrage profit, flow back to miners. In this way, miners win regardless of the MEV scenario, and the popularity of such operations grows.

A collateral effect of front-running is the execution of trades at suboptimal exchange rates, increasing costs for users of decentralised exchanges and effectively imposing an invisible tax on them.

Market arbitrage and front-running are merely two relatively simple MEV sources; over time more complex transaction-reordering strategies involving miners could become widespread. Paradigm Research researchers warn this could trigger blockchain reorganisations and instability in the consensus, too.

Researchers point to two miners — Sam and Dan — who are paid $100 per mined block. Sam finds three blocks, the first containing the arbitrage opportunity mentioned above worth $10,000 on Uni. Now Dan faces a choice: continue mining on top of Sam’s three blocks or try to re-mine the first block to grab the arbitrage profit himself.

With already three blocks, Dan ends up mining the second and third blocks as well, taking all MEV contained in them. After reorganisation, Dan has the longest chain, and they can continue operating from the third block together.

This is an example of a time-bandit attack. If the block reward is not large enough relative to the MEV, miners may find it profitable to destabilise consensus.

Researchers do not rule out that widespread use of such attacks could deter miners from investing in hash power.

“If we see such behaviour, it will probably be more frequent, shorter reorganisations. They will not fundamentally alter the mining process,” emphasised representatives of Paradigm Research.

Currently, alternative DeFi ecosystems are evolving rapidly: Binance Smart Chain, Solana, Polygon, Terra. The question arises: are these systems also suitable for MEV, or is such activity unique to Ethereum? According to Nikiforov and other experts, the strategies described are well developed in other ecosystems as well.

“MEV is not unique to Ethereum. As competition for such opportunities on Ethereum hardens, bots are migrating to alternative blockchains like Binance Smart Chain, where similar opportunities exist but with less competition,” said Ethereum developer Sam R.

Minimising MEV: Solutions

Many projects are working on ways to mitigate MEV. One of the most prominent is Flashbots, a research organisation dedicated to alleviating negative externalities and reducing MEV-related risks for Ethereum.

Flashbots has developed tools to quantify MEV and reduce information asymmetry in the ecosystem. They are pursuing Flashbots Alpha, a mechanism for private auctioning of transaction priorities implemented as a modified Ethereum client (Geth).

Flashbots also created MEV-Explore — a public dashboard showing MEV transactions in real time and various analytics. They also produced MEV-Relay — a tool connecting miners with bots while preserving privacy.


KeeperDAO
— a protocol that uses a private virtual mempool called Hiding Book. Users perform trading or lending operations via this mempool, and Keeper bots extract MEV via arbitrage or liquidations. The profits are deposited in the ROOK vault. Users receive a share of profits as ROOK tokens after fees to Keeper bots are deducted. User transactions are executed gas-free and protected against slippage and sandwich-attacks.

“Trade, borrow, and earn without becoming a target of MEV bots wandering the Dark Forest, the public Ethereum pool,” reads the project’s site.

Secret Swap is positioned as a privacy-focused cross-chain platform that is resistant to front-running, based on the automated market maker model. The project uses encrypted “secret contracts” (SNIP-20) to prevent MEV extraction.

Users need a Keplr wallet and governance tokens SCRT to pay gas-like fees. There is a 0.3% trade fee. Liquidity providers can earn SEFI tokens, then benefit from staking rewards.

The project delivers an encrypted mempool that prevents nodes and validators from viewing transaction details. The Secret Network blockchain is built on the Cosmos SDK, which supports slashing and delegation. Secret Apps are built on CosmWasm smart contracts written in Rust.

The bloXroute Labs team also developed BackRunMe — a tool enabling confidential, front-running-resistant transactions.

Nevertheless, bots can execute back-running and extract profits from arbitrage opportunities. BackRunMe can return a portion of MEV earnings to users.

“Most of these back-running operations do not affect user-submitted transactions, as they take place after their confirmations,” according to bloXroute Labs’ documentation.

A diagram below illustrates the distribution of back-running transactions: 15% to the bloXroute team, 40% to bots, 40% to users and 5% to miners.

Data: bloXroute.

Archer Swap from Archer DAO combats front-running and slippage, and helps avoid losses from unfulfilled Ethereum transactions.

MEV bots and miners share profits from operations in governance tokens ARCH. Liquidity providers supply bots with funds to execute strategies.

Interaction diagram of ecosystem participants. Data: Archer DAO blog.

Archer Swap enables switching between Uniswap and SushiSwap, offering users a familiar token-swap interface with added options and backend capabilities.

“This is not a new DEX, but an extension atop existing decentralised exchanges to provide a better user experience,” says Archer DAO’s blog post.

TaiChi Network is a private-transaction service operated by the SparkPool; transactions are visible only to the pool and are not broadcast to other Ethereum nodes, preventing MEV extraction by third parties.

Diagram of TaiChi Network operation. Data: Taichi Network.

mistX.io by Alchemist is a DEX built on Flashbots technology. User transactions do not enter the public Ethereum mempool to prevent front-running.

Interface of mistX platform. Data: docs.alchemist.wtf.

“MistX does not charge gas in its traditional sense. Instead, tips to miners are used for gas payments in mistX transactions. They are proportional to traditional gas fees, but trading on mistX provides strong protection and execution guarantees,” states the project documentation.

The Chainlink team developed Fair Sequencing Services — an MEV solution using a network of decentralised oracles to achieve “provably fair sequencing of on-chain transactions into smart contracts.”

“Separating the sequencing of transactions from the ability to produce blocks helps prevent malicious extraction of value such as front-running,” Chainlink wrote in its blog.

How FSS works in practice: time-based transaction ordering on mempool. Data: Chainlink blog.

According to its developers, FSS not only promotes fair transaction sequencing but also reduces transaction costs by dampening gas wars.

At the end of April, Gnosis presented a protocol for decentralised exchanges with MEV protection and a matching mechanism called Coincidence of Wants (CoWs). CowSwap is a decentralised exchange with DEX-aggregator features based on Gnosis Protocol v2 (GPv2).

Gnosis Protocol v2 employs technologies such as:

CowSwap routes users’ orders to GPv2. The protocol batches orders into packages and passes them to solving users (solvers), who look for the most advantageous market price and are rewarded in Gnosis tokens (GNO).

Any user could be decisive. To do so, one must:

When the best prices are found, the protocol executes the package of orders. First, it looks for CoWs trades: when wants align, the smaller order is filled into the larger one. Then GPv2 searches for liquidity on other DEXes to execute the remainder of the orders.

Paradigm Research researchers are convinced that any application can be designed to minimise the MEV it generates.

“This could become a competitive advantage by reducing costs for market participants and improving user experience,” the experts noted.

They also emphasised the importance of the EIP-1559 update, which burns base fees. This approach aims to stabilise miners’ revenues while providing incentives to secure protocol safety, potentially offsetting MEV.

Nikiforov argues that simple MEV-arbitrage avoidance strategies “have existed, exist, and will continue to exist.” For example, during token swaps a typical user can reduce their slippage tolerance and use liquidity aggregators from decentralised exchanges like 1inch.

Uniswap’s slippage-tolerance setting field that appears when you click the gear in the interface. Data: uniswap.org.

“The profitability of a ‘victim’ transaction arises from how its parameters are set. If you don’t want anyone to profit from it, you can adjust them accordingly—lower your slippage tolerance or route through pools using 1inch. If you’d rather not bother, pay a little,” Nikiforov explained.

Conclusion

The DeFi growth brings not only hacks and scams but also a relatively new risk for users of decentralised exchanges: MEV.

A broad range of MEV-mitigation solutions is in development. However, it is clear that MEV-related risks for DeFi users can only be reduced, not eliminated.

The most effective measures appear to be privacy-focused tools that prevent front-running and sandwich-attacks. These instruments share profits with users and offer other benefits, including gas-free transactions. Yet MEV strategies keep evolving and becoming more sophisticated, so current protections could become outdated.

Another potential path to reducing MEV problems is the development of layer-2 scaling solutions (L2). Vitalik Buterin believes that with Rollups, the vast majority of transactions could be conducted on L2, leaving Ethereum as the data layer with only minimal on-chain information indicating fraud (or its absence). This arrangement would deliver high throughput without compromising the base-layer security.

The Optimism team proposed its approach — MEV Auction (MEVA) that separates transaction distribution from execution. Competing with Optimism, the Arbitrum project is developing Fair Sequencing — a “fair” transaction-ordering algorithm.

The Proof-of-Stake consensus mechanism in theory could disincentivise time-bandit attacks by slashing, but for this the penalty must exceed potential MEV gains.

The move to Ethereum 2.0 (ETH2) is not far off, and, as Vitalik Buterin asserts, reorganising the blockchain to outpace profitable DeFi-user trades may prove difficult .

To carry out a full reorganisation, an attacker would need to control at least half of all validators. Introducing software to reorg is ineffective unless a large majority of validators also deploys it.

Buterin is confident that current short reorganisations are not fatal. In his view, the most effective response to MEV will be the acceleration of Ethereum 2.0.

As of 19.09.2021 there are more than 7.72 million ETH worth $26.6 billion deposited in the Ethereum 2.0 deposit contract. This substantial amount signals user confidence in the prospects of the new version of Ethereum, the launch of which is expected to be a milestone for DeFi and the wider industry.

Subscribe to ForkLog news on Telegram: ForkLog Feed — the full news stream, ForkLog — the most important news, infographics and opinions.

Exit mobile version