# Calculating the Expected Value of the Impermanent Loss in Uniswap

TL;DR: The expected impermanent loss in constant product AMMs like Uniswap and SushiSwap follows a simple expression that depends on the volatility σ and drift μ of the asset. Specifically, the expected IL is the worst for assets which have a large annual drift μ, while the impact of price volatility, surprisingly, is less important.

With the launch of Automated Market Makers (AMMs) like Uniswap and SushiSwap, any user now has the ability to become a market maker, a role that is traditionally reserved for banks and industry insiders in traditional finance.

One drawback of providing liquidity to AMMs is what has been dubbed Impermanent Loss (IL)by Pintail, first mentioned here. Here’s a brief summary of impermanent loss:

In short, the argument is that establishing a Uniswap liquidity provider (LP) position may decrease potential returns compared to holding the assets separately. Impermanent loss quantifies the difference between locking assets in a LP position and a simple holding strategy.

In this post, we answer the following questions about IL:

• What is the impermanent loss in concentrated AMMs like Uniswap v3 and Sushiswap’s Trident
• What is the expected magnitude of the impermanent loss for a given token pair.

# Expected Impermanent Loss in AMMs

In constant product AMMs like Uniswap v2 and SushiSwap, impermanent loss is computed by comparing the relative change in portfolio value V compared to a “holding” portfolio V_H in response to a small change P’→α P in the price of the underlying.

Doing this, we obtain:

We can go through a similar process to derive the impermanent loss in Uniswap v3 — note that this article by Peteris Erins arrives at the wrong answer due to not properly taking the LP range’s boundary value into account — to get:

where the range factor r = √(tH/tL). For simplicity, we assumed that the value of each token in the pool was initially the same, meaning that the LP position was initially established at the strike price K.

Plotting the impermanent loss as a function of r, the range factor of the LP position, and α, the relative change in price away from the midpoint of the LP position, we get:

It is clear from that graph that the impermanent loss for Uniswap v3 is always worse than for Uniswap v2. At best, one can attempt to replicate Uniswap v2’s impermanent loss by choosing the “Full Range” option when deploying a new Uniswap v3 position.

# Expected Impermanent Loss

We next ask what is the expected impermanent loss for a given position? Let’s consider IL under Uniswap v2. If we assume that the price of an asset can be described using Geometric Brownian Motion (GBM), we can find the expected move in price over time from the probability density function of a GBM. Doing this, we obtain for Uniswap v2/SushiSwap:

Interestingly, an important contributor to impermanent loss is the drift term μ. The drift term is often made to be equal to the risk-free rate of returns assuming that assets can be perfectly hedged.

What is the risk-free rate for real crypto assets? How does it change when prices are denominated in stablecoin vs ETH?

Here’s the drift and volatility of several crypto assets. This data was computed using daily returns data obtained from coingecko and evaluated using either USD or ETH as the numéraire:

While a few crypto assets do indeed have a low drift term in terms of USDC (eg. BTC, MKR, ZRX, BNT, LRC, BAL, 1INCH, etc.), with a few more added to that list when denominated in ETH (like UNI, INDEX, SNX, PERP), many crypto assets have a rather large drift, sometimes more than 200% per year (alpha leak!?!) and can be as low as -250%.

Combining the calculated values for the annual volatility and annual drift, we can visualize the expected IL for this basket of crypto assets:

One might be tempted to deploy their liquidity positions into less volatile pools that limit impermanent loss (for instance RAI-USDC, DAI-USDC, BTC-USDC, ETH-DPI, ETH-MKR, etc). However, since the amount of collected fees is proportional to the volatility of the assets, using strategies that lower the impermanent loss may decrease potential returns.

Can we take the accumulated fees when computing the impermanent loss?

Intuitively, the trading volume of an asset should correlate with its volatility. So here, I’m postulating that the value of the liquidity locked into a LP position will grow according to a rate that is proportional to the volatility of the underlying asset. In other words:

I chose a denominator of 6 so that the annual percentage yield is ~45% for an asset with 150% annual volatility (I may be wrong here, volatility may have no impact on volume and/or collected fees). This, assuming that volatility and fees are indeed linearly correlated to one another, we can compute the expected LP return of a position to obtain:

Plotting this for the same basket of cryptoassets shown above, we obtain:

The assets that seem to outperform (SLP, AGLD, RGT) all have a small drift and a relatively high volatility. Perhaps that should be one additional criteria to consider when choosing a LP token pair if your goal is to limit impermanent loss. Not financial advice 🤷

Takeaway: The expected impermanent loss is exactly computable, and the role of volatility in the expected value of IL is, surprisingly, less important than the drift term (which is usually ignored and set equal to zero in many asset pricing models).

Follow me on twitter for tweets and other articles about Physics, Math, Crypto, and options!

--

--

## More from Guillaume Lambert

Asst professor in Applied Physics at Cornell. LambertLab.io PI and proud father. Interests: Biophysics, Math, Crypto, and Options (often all at the same time).

## Get the Medium app

Asst professor in Applied Physics at Cornell. LambertLab.io PI and proud father. Interests: Biophysics, Math, Crypto, and Options (often all at the same time).