Quantifying LVR on Uniswap v2

Cyril Mawutor Agbenyenu - Sep 12 - - Dev Community

Introduction

Did you know that providing liquidity on Uniswap, the most popular decentralized exchange, can lead to systematic underperformance compared to a simple rebalancing strategy? This phenomenon, known as Loss-Versus-Rebalancing (LVR), highlights a hidden cost in liquidity provision that even experienced traders might overlook. LVR occurs due to price slippage when automated market makers (AMMs) like Uniswap execute trades at worse-than-market prices as asset prices fluctuate.

In this research, we’ll break down the concept of LVR, focusing specifically on its quantification within Uniswap v2. Understanding LVR is crucial for anyone participating in decentralized finance (DeFi) because it directly impacts the returns of liquidity providers (LPs). By exploring how LVR functions and how it can be measured, stakeholders will gain insights into the risks and rewards of liquidity provision, learn strategies to mitigate LVR, and discover how this knowledge can influence AMM design and fee structures in the future.

Objectives

This research aims to achieve the following objectives:

  • Quantify and estimate LVR across Ethereum mainnet and major Layer 2 networks (Arbitrum, Optimism, Base).
  • Develop a methodology to estimate and compare the Total Addressable Market (TAM) of LVR for Uniswap v2 across different networks.

Background

AMMs like Uniswap, have transformed decentralized exchanges by providing a simpler and more efficient trading mechanism compared to traditional order books used in centralized exchanges. Uniswap v2, for example, operates through a constant function market maker (CFMM) model, relying on passive liquidity providers to facilitate trades.

LVR is a key concept that measures the performance gap between passive liquidity provision in AMMs and an active rebalancing strategy that adjusts positions based on market prices. This model, inspired by the Black-Scholes framework, focuses on trading between a risky asset and a stable asset, like USDC, with the risky asset's price following a geometric Brownian motion.

In this model, arbitrageurs exploit price slippage in AMMs, where prices lag behind real-time market movements, leading to LVR. The model assumes an ideal centralized exchange (CEX) with infinite liquidity and no fees for arbitrageurs, ensuring the AMM’s price aligns with the CEX price. It also assumes AMMs follow an invariant curve, maintaining a constant product of reserves.

The LVR model is influenced by two main factors: the price variance of the risky asset and the available liquidity in the AMM. These factors impact price slippage and the overall losses associated with LVR, offering insights into the economic dynamics of liquidity provision in AMMs.


Methodology

To achieve the objectives of this research, we begin by collecting data on Uniswap v2 pool activity. The data is sourced from the defi.ez_dex_swaps table on Flipside Crypto, which provides comprehensive trade information, including block timestamp, pool name, pool address, amount in, and amount out. We filter this data specifically for Uniswap v2 trades to ensure relevance to our analysis.

Given that LVR is calculated based on the volatility between a risky asset and a numeraire (such as USDC, USDT, or DAI), we focus on trades where the output token is one of these stablecoins. This allows us to accurately assess the volatility required for the LVR calculation. By using the amount_in and amount_out fields, we can determine the minimum and maximum effective prices for each pool daily. These prices reflect the extreme values at which assets were traded within a pool on a given day.

The following SQL query is used to generate the necessary dataset:

select
  date_trunc('day', block_timestamp) as date,
  pool_name,
  contract_address as pool_addr,
  min(amount_out/amount_in) as min_ep,
  max(amount_out/amount_in) as max_ep
from ethereum.defi.ez_dex_swaps
where platform = 'uniswap-v2'
  and (token_out = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' -- USDC 
    or token_out = '0xdac17f958d2ee523a2206206994597c13d831ec7' -- USDT
    or token_out = '0x6b175474e89094c44da98b954eedeac495271d0f' -- DAI
)
group by date, pool_name, pool_addr
order by date;
Enter fullscreen mode Exit fullscreen mode

This query is adapted for each network—Ethereum, Arbitrum, Optimism, and Base—by replacing the network name and relevant contract addresses for the numeraires. While this method does not capture 100% of the trades within each pool, it is sufficient for our purposes, assuming the presence of arbitrageurs who ensure price accuracy. This approach is favored for its simplicity and effectiveness in generalizing pool behavior.

Once we have the daily minimum and maximum effective prices, we calculate the daily volatility as the percentage difference between these two extremes, similar to Today's True Range (TTR) formula. This daily volatility value is then used to compute the LVR. This calculation enables us to quantify LVR across different networks and draw meaningful comparisons.


Deep Dive

LVR on Mainnet

Mainnet Overall Average LVR - Daily, Weekly, Monthly

LVR remains consistently high across different time frames for Uniswap v2 pools on Ethereum Mainnet. The weekly average LVR is highest at about 110 basis points, followed closely by monthly and daily averages. The small variation between time frames (only about 10 basis points difference) indicates that LVR is a persistent issue rather than a short-term anomaly. Overall, the data suggests that liquidity providers consistently underperform compared to optimal rebalancing strategies, regardless of the time frame considered.

Mainnet Average Daily LVR of 10 Longest Active Pools

There is significant variation in LVR across Uniswap v2 pools on Ethereum Mainnet. The DAI-WETH pool stands out with the highest average daily LVR of nearly 200 basis points, indicating substantial underperformance compared to optimal rebalancing. LVR decreases sharply for other pools, with stablecoin pairs and those involving wrapped Bitcoin generally showing lower LVRs. This suggests that pool composition and asset volatility play crucial roles in determining LVR, with some pools performing much closer to optimal strategies than others.

Mainnet Overall Average Daily LVR Over Time

LVR was extremely high in early 2020, with significant volatility. The LVR spiked above 1,500 basis points at certain points, reflecting a period of heightened market inefficiency and higher costs for liquidity providers. After mid-2020, the LVR declined and stabilized to much lower levels, mostly below 250 basis points, indicating that over time, market conditions on Ethereum Mainnet became more efficient, with LVR settling into a more predictable range.

Mainnet Average LVR by Day of Week

LVR is relatively stable from Monday to Thursday, staying around 100 basis points. However, it slightly decreases on Friday and continues to drop through Saturday and Sunday. This indicates that liquidity provision might be more favorable over the weekend, possibly because of lower trading volumes or market activity, leading to less slippage and reduced losses from rebalancing inefficiencies.

Mainnet Average LVR by Week of Month

LVR remains relatively consistent throughout the first four weeks of the month, fluctuating between 90 and 105 basis points. However, the fifth week exhibits a significant increase in LVR, rising to approximately 115 basis points. This suggests that during months with a fifth week, liquidity provision might become less efficient or more costly, potentially due to market conditions that occur towards the end of the month.

LVR on Arbitrum

Arbitrum Overall Average LVR Daily, Weekly, Monthly

Weekly LVR is highest at about 155 basis points, followed closely by monthly LVR at around 150 basis points. Daily LVR is notably lower at approximately 125 basis points. This suggests that losses compared to optimal rebalancing strategies tend to accumulate over longer periods on Arbitrum, with weekly and monthly holdings experiencing higher relative losses than daily positions.

Arbitrum Average Daily LVR of 10 Longest Active Pools

The WETH-DAI pool shows the highest LVR at about 115 basis points, significantly higher than other pools. There's a clear descending trend in LVR as we move through the pools, with stablecoin pairs (USDC-USDT, WBTC-USDC) showing very low LVRs below 5 basis points. This indicates that certain asset pairs, particularly those involving more volatile cryptocurrencies, tend to underperform compared to optimal rebalancing strategies, while stablecoin pairs perform much closer to optimal.

Arbitrum Overall Average Daily LVR Over Time

There's high volatility in LVR, with extreme spikes reaching over 2000 basis points in early March. However, the general trend shows a decrease in LVR over time, with more recent months exhibiting lower and more stable LVR values, mostly below 500 basis points. This suggests an improvement in pool efficiency or liquidity provider strategies on Arbitrum over the observed period.

Arbitrum Average LVR by Day of Week

Thursday stands out with the highest LVR at nearly 200 basis points, indicating significantly higher losses compared to optimal rebalancing on this day. Tuesday and Sunday also show elevated LVRs above 125 basis points. In contrast, Friday has the lowest LVR at about 85 basis points, followed closely by Monday. This pattern suggests that liquidity providers might benefit from adjusting their strategies based on the day of the week, potentially focusing on rebalancing towards the end of the work week.

Arbitrum Average LVR by Week of Month

There's a significant variation in the average Loss-Versus-Rebalancing (LVR) for Uniswap v2 pools on Arbitrum across different weeks of the month, with Week 2 showing the highest LVR at about 160 basis points, followed by Week 3 at around 145 basis points. Week 4 has the lowest LVR at approximately 85 basis points. This suggests that liquidity providers may experience higher losses compared to optimal rebalancing strategies in the middle of the month, while the end of the month tends to see better performance.

LVR on Optimism

Optimism Overall Average LVR Daily, Weekly, Monthly

Weekly LVR is highest at about 65 basis points, followed by monthly LVR at around 45 basis points. Daily LVR is notably lower at approximately 21 basis points. This suggests that losses compared to optimal rebalancing strategies tend to accumulate over longer periods on Optimism, with weekly and monthly holdings experiencing higher relative losses than daily positions. The significant difference between time frames indicates that the frequency of rebalancing can have a material impact on the performance of liquidity providers on Optimism.

Optimism Average Daily LVR of 10 Longest Active Pools

The USDC-sOPWETH pool shows the highest LVR at about 155 basis points, significantly higher than other pools. The WETH-USDT pool follows with around 70 basis points. There's a sharp decline in LVR for subsequent pools, with the last five pools all showing LVRs below 5 basis points. This indicates that certain asset pairs, particularly those involving wrapped ETH or stablecoins, tend to underperform compared to optimal rebalancing strategies, while other pairs perform much closer to optimal.

Optimism Overall Average Daily LVR Over Time

The chart shows high volatility, with extreme spikes reaching over 2500 basis points in early March and around 1500 basis points in early May. However, the general trend shows a decrease in LVR over time, with more recent months exhibiting lower and more stable LVR values, mostly below 500 basis points. This suggests an improvement in pool efficiency or liquidity provider strategies on Optimism over the observed period, with occasional periods of high volatility.

Optimism Average LVR by Day of Week

Wednesday shows the highest LVR at nearly 55 basis points, followed by Monday at about 40 basis points and Thursday at around 35 basis points. The weekend days (Saturday and Sunday) and Tuesday have the lowest LVRs, all below 5 basis points. This pattern indicates that liquidity providers on Optimism might benefit from adjusting their strategies based on the day of the week, with mid-week days, especially Wednesday, showing higher potential for losses compared to optimal rebalancing.

Optimism Average LVR by Week of Month

Week 3 stands out with the highest LVR at about 52 basis points, significantly higher than other weeks. Week 2 follows with around 21 basis points, while Weeks 1 and 5 show similar LVRs of about 12-13 basis points. Week 4 has the lowest LVR at approximately 4 basis points. This pattern suggests that liquidity providers on Optimism may experience higher losses compared to optimal rebalancing strategies in the middle of the month, particularly in Week 3, while the end of the month tends to see better performance.

LVR on Base

Base Overall Average LVR Daily, Weekly, Monthly

Weekly LVR is highest at about 380 basis points, followed by monthly at around 320 basis points, and daily at approximately 260 basis points. Longer time frames (weekly and monthly) show higher average LVRs compared to daily, suggesting that the cumulative effect of price movements and trading activity over extended periods leads to greater divergence from optimal rebalancing.

Base Average Daily LVR of 10 Longest Active Pools

The WETH-DAI pool has the highest average LVR at about 500 basis points, while the USDCL-swing pool has the lowest at nearly 0 basis points. There's a steep decline in LVR from the top pools to the bottom ones. Pools involving major assets like WETH, DAI, and USDC tend to have higher LVRs, possibly due to higher trading volumes or more significant price movements in these pairs.

Base Overall Average Daily LVR Over Time

This time series chart shows the daily average LVR from March to September 2024. There's a significant spike in LVR during late March and early April, reaching peaks above 4000 basis points. After this initial period of high volatility, the LVR generally stabilizes at much lower levels, mostly below 1000 basis points, with occasional smaller spikes.

Base Average LVR by Day of Week

This chart displays the average LVR for each day of the week. Saturday shows the highest average LVR at approximately 320 basis points, while Tuesday has the lowest at about 220 basis points. There's a general upward trend from Tuesday to Saturday, with a sharp decline on Sunday. Weekend trading, particularly on Saturdays, results in higher LVR for Uniswap v2 pools on Base, possibly due to increased volatility or reduced liquidity during these periods.

Base Average LVR by Week of Month

Week 3 has the highest average LVR at around 300 basis points, while Week 1 has the lowest at about 200 basis points. There's a general trend of increasing LVR from Week 1 to Week 3, followed by a decline in Weeks 4 and 5.

Total Addressable Market

Total Addressable Market (TAM) in the context of Loss-Versus-Rebalancing (LVR) for Uniswap v2 represents the potential market size for passive liquidity provision across different blockchain networks. LVR is a crucial metric that measures the efficiency of automated market makers (AMMs) compared to active rebalancing strategies.

To estimate the TAM of LVR for Uniswap v2, we developed a model that:

  • Collects historical trading data from Uniswap v2 on each network (Ethereum mainnet, Arbitrum, Optimism, and Base).
  • Calculates daily trading volumes for each network.
  • Estimates the potential losses liquidity providers (LPs) might incur due to LVR based on price volatility.
  • Aggregates this data to determine the average daily TAM for each network and the total across all networks.

Average Daily TAM by Network

Arbitrum (Average daily TAM: $11.15 million):
The highest TAM suggests that Arbitrum has the most active Uniswap v2 ecosystem among the studied networks. This could indicate higher trading volumes and/or greater price volatility on this network. For LPs, this represents both the largest opportunity and the highest risk of impermanent loss.

Base (Average daily TAM: $10.37 million):
Close to Arbitrum's value, indicating strong adoption of Uniswap v2 on this newer Layer 2 solution. The high TAM suggests significant LP activity and potential for LVR.

Ethereum mainnet (Average daily TAM: $10.31 million):
Despite high gas fees, mainnet still shows a substantial TAM, reflecting its established ecosystem and possibly higher-value trades.

Optimism (Average daily TAM: $0.22 million):
Significantly lower than other networks, suggesting less Uniswap v2 activity or lower price volatility on Optimism. This could mean lower risk for LPs, but also lower potential returns.

Total average daily TAM ($32.06 million):
This substantial figure across all networks underscores the significant role of AMMs in the DeFi ecosystem and the scale of potential LVR.

TAM of All Networks Over Time

Given the high TAM values, especially on Arbitrum, Base, and mainnet, LPs are likely experiencing significant LVR. However, this doesn't necessarily mean they're losing money overall. In periods of high volatility and trading volume, fees earned might outweigh LVR. Conversely, in less active periods, LVR could exceed fee income.

The relatively low TAM on Optimism suggests LPs there might be experiencing less LVR, but potentially earning lower fees as well.


Conclusion

This comprehensive analysis of LVR across Uniswap v2 pools on Ethereum mainnet, Arbitrum, Optimism, and Base networks provides valuable insights into the performance of liquidity provision in decentralized finance. The research reveals significant variations in LVR across different networks, time frames, and specific pools. These findings underscore the importance of understanding LVR for liquidity providers, as it directly impacts their returns and can lead to systematic underperformance compared to optimal rebalancing strategies.

The Total Addressable Market (TAM) analysis further emphasizes the scale and significance of LVR in the DeFi ecosystem. With a total average daily TAM of $32.06 million across all studied networks, it's clear that LVR represents a substantial economic factor in automated market maker (AMM) dynamics. The varying TAM values across networks, with Arbitrum leading at $11.15 million and Optimism trailing at $0.22 million, highlight the differences in market activity and potential risks and opportunities for liquidity providers on each platform.

As the DeFi landscape continues to evolve, this research serves as a crucial resource for stakeholders to make informed decisions about liquidity provision strategies. The insights gained from this study can guide the development of more efficient AMM designs, help liquidity providers optimize their strategies to mitigate LVR and inform the broader community about the hidden costs associated with passive liquidity provision. Future research could explore how these findings translate to newer AMM models and investigate strategies to minimize LVR while maximizing returns for liquidity providers.


References


About the Author

mawutor (@polymawutor) is a web3 developer with a passion for exploring the latest advancements in blockchain technology. With a focus on providing informative content and building innovative solutions, mawutor aims to demystify complex topics and empower users with actionable insights.

. . . . .
Terabox Video Player