Dissecting MEV Arbitrage

A non-exhaustive classification with examples

Alex Zaidelson
7 min readOct 20, 2022

Intro

This article is part of our Tales From The Dark Forest series. In the series, we share results of our DeFI research with the community, educating both our readers and ourselves.

In this article, we will be covering various types of MEV arbitrage that we have been observing in the wild on the Ethereum blockchain.

WTF is MEV?

Essentially, MEV refers to the profit that can be made by reordering transactions in a block and inserting new transactions between them.

MEV was born in the proof-of-work context and initially stood for Miner Extractable Value. Later, the meaning of the acronym was adjusted to Maximal Extractable Value.

With the advent of DeFi, the amount of MEV arbitrage opportunities grew enormously. Indeed, the information about the status of the pools is freely available (albeit with some effort), and MEV searchers are constantly evaluating opportunities to buy low and sell high, getting more and more sophisticated day by day.

It is not enough to identify a profit opportunity, it is also important to be the first to snatch it before anyone else does. That’s why MEV searchers cooperate with miners / validators to have their transactions placed in the beginning of signed blocks before anyone else’s.

MEV arbitrage can be roughly divided into the following 3 categories:

  • CEX Arbitrage
  • Positional DEX arbitrage
  • Sandwich Arbitrage

The estimated total trade volume for the three arbitrage types is shown below:

Total volume of MEV transactions

We will now dive in and discuss each type of arbitrage in more detail.

CEX arbitrage

In CEX arbitrage, the MEV searchers identify AMM pools where the price of an asset is lower than on a centralized exchange, offering the opportunity to buy that asset cheaply and sell higher. This may happen due to an external price change, or due to pools getting out of balance as the result of a prior trade.

Here’s a nice $6.4M example of such trade showing an MEV bot buying 4,506.8 ETH, apparently to sell higher on a centralized exchange.

An MEV bot buys 4,506.8 ETH

This arbitrage is risky since it cannot be done atomically, and the price on the CEX may change before the profit is realized.

CEX arbitrage is by far the largest kind of MEV arbitrage, both by total trading volume and by number of transactions. Arguably, it is also the most profitable, but it is harder to estimate since closing the positions mostly happens outside DeFi and thus not visible to our research tools.

CEX arbitrage is beneficial for the DEX ecosystem because it keeps the pools in balance. On the other hand, this kind of arbitrage takes value from the LPs — any gain of the arbitrageurs is essentially the loss of LPs. Specifically, the infamous Impermanent Loss that LPs suffer from comes from the arbitrage on external price changes.

Positional DEX arbitrage

Positional DEX arbitrage happens when MEV searchers identify an opportunity to buy an asset cheaply in one DEX pool and to sell it more expensively in another pool. Here’s how 1967 ETH are made in one fell swoop:

Here, the MEV searchers identified a large previous trade that put a Uniswap V2 WETH-WBCT pool on huge imbalance, and immediately capitalized on the opportunity to buy cheap BTC in the pool.

This trade was covered in our #talesfromthedarkforest tweet from Aug 8, 2022

This kind of arbitrage is very profitable, and, together with CEX arbitrage, is essential for functioning of the DEX ecosystem. It keeps pools balanced, making sure that the ratios between the two sides of the pools reflect the actual market price. Same as CEX Arbitrage, it also takes large amounts of value out of the system, hurting LP returns.

According to our research, an average positional arbitrage transaction generates 0.38% return on the funds used in the trade.

Sandwich Arbitrage

A Sandwich Arbitrage is a special case of frontrunning. For example, the arbitrageur might identify a large swap by a victim trader, and wrap it with two trades on the same pair — first one going in the same direction, and the second one in the opposite direction. As a result, the trade becomes more expensive for the unsuspecting victim, and the arbitrageur rides the AMM curve buying the same amount of asset lower and selling it higher immediately after the victim trade happens.

An example:

A naive trader initiates a transaction swapping 65.91 ETH to 50,000 BONE tokens on ShibaSwap. An MEV searcher identifies that transaction (and the way it will disbalance the pool), and does the following:

  1. Inserts a transaction right before it, selling 16.36 ETH for 12,566 BONE
  2. Inserts another transaction right after it, selling the 12,566 BONE for 16.59 ETH, netting a 0.23 ETH in profit
Sandwitch arbitrage — victim transaction in the middle

There are various types of sandwich arbitrages, ranging from simple frontrunning shown above to more sophisticated transactions involving loans, liquidity provision and more.

This kind of arbitrage mostly harms the naive traders making them pay higher trading costs, and does not benefit the system in general.

According to our research, Sandwich arbitrages generate an average 0.14% profit on each trade.

Arbitrage Profits

It is clear that MEV bots are taking a lot of value out of the DEX ecosystem. But how much value? The chart below shows the weekly profits generated by positional arbitrages and sandwich arbitrages since the beginning of the year

It can be seen that the profits dropped from over $5M/week down to about $2M/week.

The chart does not include CEX Arbitrage profits — we currently don’t have a way to measure it.

Bonus — LP Sandwich Arbitrage

This is a different kind of arbitrage — it relies on liquidity provision rather than on trading. We observe LP Sandwich arbitrage only AMM pools with concentrated liquidity, mostly on UniSwap V3.

Here, the arbitrageur identifies a sufficiently large trade on a CLAMM pool, and puts a large amount of liquidity into the pool at the specific price point the trade is about to happen, getting the transaction fee and the price impact profit largely to themselves.

The volume of LP Sandwich arbitrages is quite high, reaching billions of dollars per week, with larger sandwiches reaching $50M.

An example of LP Sandwich Arbitrage, exact URLs in our tweet

This kind of arbitrage is detrimental to the existing LPs in the pool, but is actually beneficial to the trader since higher liquidity leads to lower price impact of the trade and saves money to the trader. We will be providing more information on this kind arbitrage in our later publications.

Methodology

Our research is mostly done using the publicly available Google Big Query bigquery-public-data.crypto_ethereum dataset containing Ethereum transactions and log data. The dataset was created and is constantly maintained by Evgeny Medvedev and the blockchain_etl team, to whom we express our gratitude and admiration.

We use the transactions and logs tables to parse call traces and event logs issued by DEX smart contracts and thus retrieve information on DEX transactions. We also use multiple scraping scripts to retrieve additional metadata such as token names, contract names, pool definitions and more.

Based on the raw data, we have built our own processed dataset containing parsed information about DEX transactions aggregated on different levels, and enriched with pool, token and contract information. At the moment of publishing this article, the dataset supports the following DEXes: Uniswap V2 (and all its clones like SushiSwap, etc.), Uniswap V3, Curve and DodoEx. We are gradually adding more DEXes to the dataset.

USD volume estimates are calculated based on average daily asset prices derived from DEX trades.

MEV Bots are identified using publicly available Etherscan tags.

Conclusion

MEV Arbitrage is a huge force in the DeFi economy. It is draining value from the ecosystem, but is also absolutely essential to its existence — without MEV Arbitrage the pools would become unbalanced and barely usable.

At VirtuSwap, one of the key design goals is to reduce the amount of value taken away by the MEV arbitrageurs, but to keep their beneficial influence on the overall balance of the ecosystem, and our reserve-based trading technology achieves that goal gracefully.

On a poetic note, I am looking at the MEV bots with a mix of fear and admiration — they remind me of the merciless Sentinels seen in the Matrix, but they are also wise and incredibly efficient, and researching their behavior in the wild is a fascinating endeavor. We will continue investing in this research, both for the public benefit and for deepening our DeFi expertise.

AI imagery generated for “scary robots hunting in the dark forest”

Do you have comments on this research? Ideas on how to improve it? Want to participate? Write to us at contact@virtuswap.io or on our social channels.

VirtuSwap is a new kind of DEX with unrivaled efficiency.

VirtuSwap team is comprised of finance professors and crypto veterans, and backed by industry heavyweights.

We are on a mission to make DEXes dominate the crypto trading landscape, and we are accomplishing it through research, financial engineering and data science.

Don’t forget to like and share.

Follow us on: Twitter | LinkedIn | Telegram | Medium| Website

--

--

Alex Zaidelson

CEO at SCRT Labs, Adviser at VirtuSwap, former CEO at Beam. Researcher, Builder, Believer.