Here we will examine the same circumstance as shown in the 50/50 Pools example to compare what effect a change in pool weights can have on a liquidity provider's investment.
COMP WETH 80/20
To emphasize the weighting of 80 / 20 as opposed to 50/50 we will observe impermanent loss under the COMP favoring pool conditions to display the benefits of uneven pool weightings. We will in turn hold 1 WETH @ $2000.00 each and 32 COMP @ $250.00 each. ($8000 in COMP and $2000 in WETH).
Our gains will then be determined by the invariant ratio. This can be used for our token balances are well.
Here we can consider the USD values to be the same in the numerator and denominator therefore not needed to determine the ratio between the two.
While impermanent loss is still applicable in this scenario in comparison to the 50/50 pool the losses are nearly cut in half (a factor of 0.5825 more precisely). When dealing with very large investments these small amounts can make a large difference in value and ultimately weighting will protect or expose investors from impermanent loss depending on their choices. However if prices return to their initial state or follow the same price change at a certain point the “losses” will revert to zero regardless of weighting.
Examples will include impermanent loss calculations for a traditional AMM style pool (50/50) with swap fees or "APY" included.
We will start with a simple 50/50 pool featuring COMP/WETH. We take a time when WETH is worth $2,000 USD and we have 2.5 WETH ($5,000.00). At the same time COMP is worth $250.00 therefore we are investing 20 COMP tokens. Our liquidity position is deposited and we receive pool tokens for this $10,000 investment.
We check back out our position after a period of time and COMP has doubled, 100% gains straight to $500.00 USD. WETH has only made it up to $2300.00 at this point, gains of just 15%. We know at this point we will face some impermanent loss. We still have strictly gains but due to our liquidity position we are missing out on some of our investment in theory.
Here we calculate the invariant from the value function:
Here we can consider the USD values to be the same in the numerator and denominator therefore not needed to determine the ratio between the two.
For the new token balances we consider the invariant ratio compared to the price action of the individual asset. This proportion will yield the new balance of each token in relation to the initial investment.
Please note these calculations can take place over any time frame. These occurred in roughly 12 days between June 25 and July 07 of 2021. This same price action can take place over the course of 1 year and with 4% or more in swap fees or liquidity mining accumulating the LP position would become the more rewarding option.
These calculations are depicted by the following tables.
Initial Investment: $10,000.00
HODL Total: $15750.00
LP Total $15165.75; with 4% Annual yield $15,772.38
In our prior example COMP and WETH went through divergent price changes. When this happens, we saw the potential loss of value that can be created by the nature of impermanent loss. Now if our prices continue to change, we will look at an example where WETH goes up to a price of $3000.00 and COMP decreases down to $375.00. While these are diverging prices changes this will bring us to a 50% gain for both assets in relation to our original investment.
Therefore, because our invariant ratio matches our price action ratio, we have an indicator that there will be no impermanent loss.
This calculation will be done from the point where impermanent loss was experienced to the current state to prove the “loss” is indeed reversible under the proper conditions.
Initially:
After Price Change:
New Token Balances can be calculated as follows:
These balances match our initial investment meaning overall we lost nothing impermanent loss. The price action is still in our favor by 50% for both assets as we hold the same initial number of each. Also, we would have likely earned swap fees for this from traders making our gains slightly larger.
Through the price action regardless of how dramatic impermanent loss can be reversed as seen above. This can occur countless times as prices of assets in a pool fluctuate in price. The importance of this is understanding the assets you are holding and how comfortable you are with volatility. In theory great volatility will be coupled with large volumes of trading making the swap fees and gains for liquidity providers increase. Weighing the risk of impermanent loss with the reward of accumulating swap fees or “volatility farming” is the game of a liquidity provider long term.
Balancer's multi-token pools are on of our unique features. Below is an example of how impermanent loss on one of these pools on the can occur. Inclusive of details on volatility and stable coins.
Advanced Example – Multi Token Pool
An example of a multi token pool and how impermanent loss would occur and then be reverted will be solved below. We will look at a polygon pool: 25% USDC, 25% WMATIC, 25% BAL, 25% WETH. Initially we will assume we invested $10,000 in USD evenly amongst the assets.
Initial Conditions:
We will assume USDC stays at a constant value, BAL increase by 15% to $28.75, WMATIC decreases 4% to $1.20, and WETH increase 50% to $3750.00.
New Token Balances can be calculated as follows:
Due to a stable coin (USDC) being a portion of the pool impermanent loss is nearly inevitable unless all tokens return to their initial value at the time of investment. Therefore, the pool above and any pool with stables and non-stable assets an investor is concerned mostly with volatility and their profit to be made from swap fees or reward APY. Essentially investing in their confidence for this type of price pattern:
At any point where all prices revert to their initial investment arbitragers will bring the tokens back to their initial balances. With a stable token present this would mean no gains can be made without impermanent loss or swap fees being present. In turn the goal can be considered to have low IL and high swap or reward APY for a liquidity provider with these types of investments. Also, it can be viewed to manage exposure to volatile assets.
In this section we describe what impermanent loss is, how it occurs, the risks associated with it, and how our users can recognize the potential effects on their investment decisions.
Impermanent Loss is an extremely hot topic within decentralized finance and rightfully so. Often liquidity providers are supplying funds to a pool with a surface level understanding of how impermanent loss can affect their position. While commonly discussed as potentially wipe out the value of an entire pool or slowly chip away at their potential gains the tradeoff of volatility harvesting is not often emphasized.
The reality of impermanent loss is that it is a dynamic and reversible occurrence which is only realized when a position is removed from a liquidity pool, at this point is becomes a permanent loss. The liquidity provided is an investment on either volatility or that both assets will show extremely similar price action while accumulating trading fees. The fees are a tax paid by traders and in some cases traders are called “arbitragers”. These fees are awarded to the liquidity provider and the market making platform (in most cases) in order to incentivize the holder of a liquidity position to continue to give them a trading source.
Impermanent loss occurs when the prices of two assets experience a divergence in price action. For example if two assets increase by 20% no impermanent loss is noticed. However if one asset increases in value by 20% then a divergence has taken place and some form of impermanent loss would be noticed in the position. This can be reversed by the other token in the pool also increasing 20% or both tokens converging on the same price movement relative to the original investment. A basic example of impermanent loss followed by reversal scenario are is outlined on the following page.