MEV’s Impact on Uniswap

MEV (Maximal Extractable Value) has already become a central topic in 2022, not very long since the original notion was proposed. MEV is also regarded as permissionless incentives in blockchains, extractable on a first-come basis. However, the attractive wealth opportunities in the dark forest are also hard-to-discover and require specialized capabilities. These facts raise concerns about public issues within Ethereum’s ecosystem, from the block congestion problem caused by Priority Gas Auction (PGA) to more critical security issues due to possible vulnerabilities among the validators and block builders.

AMM is one of the most relevant components, if not the most important one, during the extraction process of MEV. Users of AMM are unavoidably connected to MEV bots as a result of the transparency of mempools. This tweet directly reflects the trouble users may face. From another point of view, arbitrage bots play a vital role in improving the efficiency of price discovery in AMM markets. When exploring how MEV has impacted users on Uniswap, there are two aspects the stakeholders may consider necessary:

  1. To what extent is the impact on the Uniswap community and its users?
  2. Which Uniswap users and liquidity pools are more likely to be involved?

In this report, we find some interesting and inspiring conclusions and shed light on these questions. The results are based on a sample of observations and data analysis. While the maximal extractable value from the dark forest is hard to be calculated, we can calibrate the MEV market and its impact by observing the extracted asset values. In the following, we present an analysis focusing on three types of MEV bot activity targeting Uniswap V3’s liquidity pools.

Overview

Revenue of Bots’ Activities

A Comparison of Total Revenue Scales

One part of MEV bots’ revenue comes from the arbitrage gain when reducing the price spread between markets, which is also reflected in the impermanent loss of liquidity providers (LPs) and slippage loss of swap users. And another part of revenue comes from front-running users’ swap transactions and causing them to bear additional slippage losses. JIT bots are unique concerning Uniswap V3’s new feature — concentrated liquidity. They play the role of highly active LP and extract swap fee revenues from other passive LPs.

We intuitively measure the scale of extracted revenue by these bots and compare it to that of the commonly defined supply-side revenue of Uniswap V3.

Let’s look at the performances of different types of MEVs. During the period from January 1st to October 31th, 2022:

  • Arbitrage bots have extracted at least $85 M from market price asymmetry involving Uniswap V3 pools.
  • Sandwich bots have extracted at least $47 M from Uniswap V3 pools’ swap users.
  • JIT bots have extracted $6 M from Uniswap V3’s swap fee revenue.
  • The total extracted value of these three types has crossed 25% of the supply-side revenue ( i.e., LP’s revenue from swap fee), $540 M.

Before the dark forest and MEV bots entered the public eye, LPs, swap users, and governance token holders played significant roles in AMM’s community. And TVL, volume, fee rate, slippage, liquidity mining yield were the primary indicators that mattered. Nowadays, from the perspective of the extracted value’s scale, MEV bots are one of the components that this community cannot bear to ignore.

The community has become more diverse and evolved into a more complex value transfer network. Given this pattern, MEV data has become a valuable asset for enhancing decision-making. One of the goals of this report and future work is to outline this network transparently. And tracking its evolution from time to time can help the related parties better understand how MEV affects the Uniswap community in the long term.

Let’s start by examining the monthly revenue data for this year.

From the correlation coefficients below, there is no negative correlation between arbitrage bots’ and sandwich bots’ revenues and that of LPs (Source: Dune, @messari / Messari: Uniswap Macro Financial Statements), which means there are no apparent interest conflicts between these agents. However, their revenues are more likely to fluctuate following the whole market in recent months.

Comparing revenue gain among different kinds of MEV bots, we find that arbitrage bots can extract more values than other types. The monthly revenue of JIT bots is one order of magnitude smaller than that of the other two types and has not yet shown a clear trend, which is also related to the fact that such opportunities are just emerging.

Volume Contribution

Volume contribution to Uniswap from these MEV bots is another way to calibrate the impact on the macroscopic level.

From the histogram below, we can see in most arbitrage observations; tokens are swapped between Uniswap V3 pools and other venues.

Therefore, to investigate the volume contribution of arbitrage events, one cannot simply sum up the volume of arbitrage and compare it with Uniswap V3’s total volume, in which volume contributed to other venues will also be counted. Instead, a more convincing way is to consider the volume that occurred directly at Uniswap V3 pools. The same logic is also applied to calculating volume contribution by sandwich bots.

JIT bots don’t need to issue swap transactions; they add and remove liquidity to extract the swap fee. However, we can measure the volume of targeted swap transactions in a JIT event to study the impact on swap users.

We will explore it in future reports.

Frequency Analysis

Daily Count of Observations

We can also detect how frequently these bots spot MEV opportunities by observing the daily count of observations. Although the following results present an observed minimum set, comparing the data along a timeline or bot type is still reasonable.

The plot below shows a significant increase in arbitrage bots’ activities starting from May this year. In contrast, the observation frequency of sandwich bots remained at a stable level. Apparently, arbitrage bots are more likely to find MEV opportunities than other bots.

The fluctuation of observation frequency positively correlates with the absolute price change of representative crypto assets in terms of arbitrage and sandwich activities. Here we present an example of ETH’s 7-day price change percent (a moving averaged result of the absolute value, source: historical close price from coinmarketcap.com). And the correlation coefficient between the moving averages is around 0.43 for arbitrage bots and 0.60 for sandwich bots. The result shows to a certain extent that the occurrence of trading opportunities is related to the intensity of market price fluctuations, which is quite reasonable. The structural growth of arbitrage bot’s activities since May could also be related to other factors, such as a reduction in average gas price in recent months, which is not the focus of this report.

Meanwhile, JIT bots have seen an increasing opportunity trend in recent months.

Profit of Observations

MEV bots’ actual profit left in their pockets is another parameter to predict how attractive the MEV market will be for outsiders in the future. Evaluation in this aspect requires more careful and granular processing of the data for two reasons:

  • Merely relying on the on-chain data for an accurate answer is not enough because there is survivorship bias. For example, maybe a bot that looks profitable from on-chain transactions still suffers from many failed transactions’ costs or other hedging costs off-chain.
  • The process of converting token prices into US dollars may strongly affect the evaluation of bots’ profitability. This is because every penny counts when the price error is close to the difference between revenue and cost, which is the profit data we want. Besides, the realizable liquidity of long-tail assets is also a factor to be considered.

We are working on optimizing the calculation of token prices. The results below are based on the latest version of our price index.

From the daily profit distribution, we can see that arbitrage and sandwich bots gain an average profit on most days and have a few lucky days to make a lot of money. For example, on August 1st, the arbitrage bots’ daily profit reached over $4.47 M. On that day, a simple spatial arbitrage contributed 71.6% ($3.20 M). From the daily profit percentage of JIT bots, they seem to make more money than arbitrage bots sometimes.

Both the profit and loss of a single observation are in line with the fat tail distribution. Compared to arbitrage bots’ profitability, sandwich bots and JIT bots follow the same distribution attributes, yet the maximal profit in a single observation they can extract is at least one order of magnitude smaller. From the perspective of the on-chain transactions, MEV bots will also suffer considerable losses in a single action.

Cost of Observations and Miner Extracted Value

For miners to package their transactions timely, MEV bots participate in the gas fee auction market, and the fierce competition drives up the cost of gas fees very high. Institutions such as Flashbots have launched marketplaces for off-chain auctions, and some of these auction costs are converted into miner tips in the form of coinbase.transfer(). These two parts of the cost constitute the main explicit cost for MEV bots to participate in the MEV market. Using it as a percentage of revenue, we can understand the level of profit margins for bots and how much MEV value is being extracted by miners.

The average transaction cost of bots (gas fees and tips to miners) has a downward trend overall. However, the cost of sandwich bots is higher than the other two kinds, and the proportion of revenue allocated to miners has grown significantly, approaching 90% in October.

The proportion of revenue arbitrage bots paying miners has a downward trend, below 50% in October. The percentage of miner extracted value from JIT bots is the lowest, which is consistent with the less competitive situation they are engaging in right now.

In total, more than half of the extracted value actually flows into the miners’ pockets.

Impact on Pools

We can also observe which liquidity pools are more likely to be involved in MEV activities. Let’s break down this issue into feature analysis and correlation analysis tasks. In this report, we present a general result as a first step.

We merge Uniswap V3 pools’ metadata and the parameters of MEV activities grouped by pool address, as shown in the following picture. Since the profitability parameters of arbitrage bot involve both Uniswap V3 pools and other venues, we put that aside and focus on the frequency of bot activity, tthe profitability of sandwich bots and JIT bots, and the situation of the involved swap users.

The results show that over 80% of sandwich bots’ profit comes from the top 10 pools sorted by trading volume. However, only 20% of sandwich activities occur in these pools, which means pools with large trading volumes are easier for sandwich bots to extract value from, but swap users of other pools may still be sandwiched frequently. This fact is also validated by the distribution of the number of unique swap users that suffer from sandwich activity in each pool. A few pools are also not involved in sandwich activities during the time range we observed.

Regarding JIT bots, they seem to be more focused on the top 10 pools sorted by trading volume. While 84% of profit was extracted from these pools, 56% of JIT activities also happened here.

Pools with a fee tier that equals 0.0005 or 0.0001 are more likely to be extracted in terms of arbitrage bots’ average activity frequency in these pools. Pools with fee tier 0.0005 suffer mostly from sandwich activities. JIT activities also happen mostly in pools with a fee tier 0.0005.

We also present the histogram of several parameters grouped by pool address. The result also obeys fat tail distributions, which means a small bunch of pools is involved much more than the average level.

Compared to other venues, Uniswap V3 pools related to crypto assets, USDC, WETH, and USDT, are the hottest pools that MEV bots like to interact with. You can view statistics of hot liquidity pools sorted by trading volume or trading volume change percentage in MEV activities on our website in real time.

Participants

Interaction relationship among MEV bots and other users is also an attractive topic. The following table and figure compare the number of different agent types involved in MEV activities in our observing scope. From the right panel, we see an increasing trend of unique swap user addresses that can benefit from JIT activities.

However, by counting the number of unique bot contracts and involved users’ addresses, it’s hard to comment on how many entities are behind these addresses since different addresses may belong to one entity. A vivid interaction network mapping transaction relationships of these addresses can help understand this question better, which is not covered in this report.

Arbitrage Bot

Arbitrage Bot Leaderboard (Top 20)

The following plots show the top 20 arbitrage contract addresses sorted by total profit and total activity count, respectively. The relationship between total profit and total activity count shows a positive relationship with a ceiling value of profit a bot can maximally extract.

Frequency of Arbitrage Patterns

We can observe the arbitrage transactions’ structure by counting the number of venues involved and the percentage of Uniswap V3 pools involved. The top 10 possible combinations show that spatial arbitrage involving one Uniswap V3 pool and another venue is the most common pattern. The subsequent two common patterns are triangle arbitrage involving one or two Uniswap V3 pools.

Another interesting finding is that there are also many arbitrage opportunities among Uniswap V3 pools alone. A single arbitrage transaction can also involve more than 100 venues (for example)

Arbitrage Bot as a User Itself

Arbitrage bots, as also a kind of swap user of AMM, suffer from taxed token contracts other than severe gas fee campaigns. The following data and graph show that while most profitable arbitrage transactions do not involve the taxed tokens, it does not rule out that some particularly excellent bots can find wealth in taxed tokens. There is a subtle trend that more profitable arbitrage bots are likely to be involved in fewer percentage of taxed tokens.

A Break Down of Profitability

We also put the distribution of profitability parameters below for the reference of interested parties.

Sandwich

Sandwich Bot Leaderboard (Top 20)

The following panels show the top 20 sandwich contracts’ addresses sorted by total profit or total activity frequency respectively. The relationship between total profit and total activity count shows that most profitable bots are more capable of successfully submitting transactions more than 100 times this year.

Swap Users Get Sandwiched

In most cases, there is only one swap user sandwiched in a single sandwich activity. But sometimes, the sandwich bots can front-run up to 4 swap users’ swap transactions in one shot within our observation scope.

From the top 20 sandwich victim data below, the most suffering swap user was involved in over 300 sandwich transactions this year.

Sandwich Activities in Venues

From the top 10 exploited contracts, which can be viewed on our website in real-time, we see that Uniswap pools are mostly involved in sandwich activities compared to other venues. This is partly due to the vast transaction volume of these Uniswap pools, which is an advantage for sandwich bots.

A Break Down of Profitability

We also put the distribution of profitability parameters below for the reference of interested parties.

JIT

JIT Bot Leaderboard (Top 20)

We only observe 6 JIT bots by detecting unique “to address” in JIT bots’ add liquidity transactions. Two of them haven’t gained profit yet.

Swap Users Benefit from JIT

JIT bots can provide a large amount of liquidity to targeted swap users, making it an advantage for them to have smaller slippage loss. From the top 20 beneficiary data below, many swap users are enjoying this new feature frequently. We calibrate the benefit by simulating possible slippage the swap user may bear without JIT bots’ activity in each observation. From the histogram of both simulated slippage and actual slippage as presented below, a clear shift from larger slippage rates to smaller ones can be seen. During the calculation, we also find that there are negative slippage values in a few cases. By checking the reason manually, we find that in some JIT bots’ transactions that add liquidity, they will perform reverse swap transactions for some reason, which brings a more favorable price to the next swap user.

From a list of top 20 beneficiary below, we see quite a few swap users are already enjoying this new feature frequently.

A Break Down of Profitability

We also put the distribution of profitability parameters below for the reference of interested parties.

Conclusion

From the above analysis, we can see that robots have become an integral part of the AMM community that cannot be ignored. Understanding the transaction relationship between MEV bots and other entities can help stakeholders better understand the long-term impact of MEV on AMM.

In this report, we characterize the above relationship from different perspectives and draw some interesting conclusions based on a solid data source and data analysis:

  • Revenue — From the scale of revenue extracted by bots, we see that arbitrage bots have extracted at least $85 M from market price asymmetry involving Uniswap V3 pools. Sandwich bots have extracted at least $47 M from swap users in the form of slippage loss. JIT bots have extracted $6 M from Uniswap V3’s swap fee revenue. The total revenue of bots accounts for 25% of LP’s revenue. However, there are no apparent interest conflicts between arbitrage bot, sandwich bot, and LPs. Their revenues are more likely to fluctuate following the market in recent months. The monthly revenue of the JIT bots is one order of magnitude smaller than that of the other two types and has not yet shown a clear trend.
  • Frequency — Arbitrage bots are more likely to find trading opportunities compared to other bots. A significant increase in arbitrage bots’ activities can be seen starting from May this year, whereas the observation frequency of sandwich bots remained stable. Trading opportunities are positively correlated to the intensity of market price fluctuations. JIT bot is seeing an increasing trend of trading opportunities in recent months.
  • Profitability — MEV bots gain an average profit on most days and have a few lucky days to make a lot of money. Both the profit and loss of a single observation are in line with the fat tail distribution. The maximum profit sandwich bots can get is one order of magnitude smaller than that of arbitrage bots, due to fewer trading opportunities, more cost, and more fierce competition between bots. JIT bot is still in the early stage.
  • Cost — The average transaction cost of bots has had a downward trend in recent months. The cost of sandwich bots is higher than arbitrage bots, and the proportion of revenue allocated to miners has grown significantly, approaching 90% in October, compared to a downward trend reducing below 30% in terms of arbitrage bots. In total, more than half of the extracted value flows into the miners’ pockets.
  • Pools — Over 80% of sandwich bots’ profit comes from the top 10 pools sorted by trading volume. However, only 20% of sandwich activities occur in these pools. A few pools are also not involved in sandwich activities during the time range we observed. JIT bots seem to be more focused on the top 10 pools sorted by trading volume with 84% of profit being extracted from these pools and 56% of JIT activities also happening here. Pools with a fee tier that equals 0.0005 or 0.0001 are more likely to be extracted by arbitrage bots. Pools with fee tier 0.0005 suffers mostly from sandwich activities and JIT activities. The fat tail distribution of parameters grouped by the pool also shows that a few pools are involved much more than the average level.
  • Participants — There seems to be an increasing trend of unique swap users that can benefit from JIT activities. The slippage data from both actual swap transactions and simulation also validates this point. There are other protocols also offering strategic liquidity providing bot services to LPs who are seeking more yield. Their strategies mainly allocate liquidity in a narrow range and adjust the tick intervals to track market price based on quantitative indicators such as Bollinger Bands. Compared to these kinds of strategies, JIT bots are trying to solve the same problem in an innovative and more capital-efficient way. It is worth considering for related parties such as AMM protocol designers to directly provide similar features, which can connect swap users and LPs in a new way while improving user experience and enhancing LPs’ revenue.
  • Bots — We also list the top 20 bot contract addresses sorted by total profit and activity count, respectively. The relationship between total profit and total activity count shows a positive correlation with a ceiling value of profit a bot can maximally extract. Regarding how arbitrage bots treat taxed tokens, most profitable arbitrage transactions do not involve the taxed tokens. But it does not rule out that there are some particularly excellent bots that can find wealth in taxed tokens. In most cases, there is only one swap user sandwiched in a single sandwich activity. But in some cases, the sandwich bots can front-run up to 4 swap users’ swap transactions in one shot within our observation scope. The most suffering swap user was involved in over 300 sandwich transactions this year.
  • Transaction Pattern — Through observing the arbitrage transactions’ structure, we find that spatial arbitrage involving one Uniswap V3 pool and another venue is the most common pattern. The following two common patterns are triangle arbitrage involving one or two Uniswap V3 pools. There are also many arbitrage opportunities among Uniswap V3 pools alone. And a single arbitrage transaction involving more than 100 venues can also make a profit.

Methodology

Data Source

The above analysis is based on the raw block data fetched from the full Ethereum node we built. The data range covered is from block number 13916166 (include) to 15871479 (include). We decode the raw data to get the fine-grained data field we need.

To compare certain parameters with the overall market situation and Uniswap V3’s macroscopic parameters, we adopted data from third parties as listed below:

  1. ETH’s historical close price from coinmarketcap. https://coinmarketcap.com/currencies/ethereum/historical-data/
  2. Uniswap V3’s daily meta data from dune@messari / Messari: Uniswap Macro Financial Statements. https://dune.com/messari/Messari:-Uniswap-Macro-Financial-Statements
  3. Uniswap V3’s meta data from https://www.uniswap.shippooor.xyz/. (Chain: Ethereum, Dataset: Pools)

How Do We Identify Bots?

  • We consider a transaction to be a collection of asset transfers, and we use a set of rules to see if an MEV activity has happened by assessing the outcomes of these transfers. The rule of thumb is that there is more than one transfer (or swap) in the transaction, and the trader ends up with a surplus.
  • To identify different types of MEV activity, we collect observations obeying our heuristic rules for each type in the current stage, and we continue enhancing our algorithms according to false negative or false positive detected by comparing the sample results with those from MEV-inspect each day.
  • In this report, we identified three types of MEV activity with Uniswap V3 pools involved. The total number of Uniswap V3 pool addresses we covered is 8837, including those from failed factory transactions, as compared to 8767 pools listed in the third-party data sources. The total number of arbitrage, sandwich, and JIT observations is 663889, 90291, and 13020 respectively.

How Do We Calculate Profit and Cost?

  • We are constantly optimizing our price index algorithm. At present, we directly equate USDT, USDC, and DAI to 1 USD. For mainstream assets with relatively good liquidity (ETH, WETH, WBTC), the AMM and on-chain oracles can provide a relatively reliable quote source. With these mainstream assets’ prices settled down, we further calculate the prices of other tokens based on the swap ratio at the time of calculation.
  • We only consider on-chain costs for each transaction detected. The calculation process is summing up the gas fee and the coinbase.transfer() value (if there is any) of each transaction and converting the result to USD based on the ETH’s price.

Disclaimer

The information contained in this post (the “Information” has been prepared solely for informational purposes, is in summary form, and does not purport to be complete. The Information is not, and is not intended to be, an offer to sell, or a solicitation of an offer to purchase, any securities. The Information does not provide and should not be treated as giving investment advice. The Information does not take into account specific investment objectives, financial situation or the particular needs of any prospective investor. No representation or warranty is made, expressed or implied, with respect to the fairness, correctness, accuracy, reasonableness or completeness of the Information.

We do not undertake to update the Information. It should not be regarded by prospective investors as a substitute for the exercise of their own judgment or research. Prospective investors should consult with their own legal, regulatory, tax, business, investment, financial and accounting advisers to the extent that they deem it necessary, and make any investment decisions based upon their own judgment and advice from such advisers as they deem necessary and not upon any view expressed herein.

*We are open to discussion, please feel free to contact us via contact@eigenphi.com.

Subscribe to EigenPhi
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.