Search…
Risk and Return

Impermanent Loss

The standard impermanent loss return profile for a Uniswap V2 style LP position is shown below. This curve was originally introduced by Pintail in their blog post on Uniswap. The x-axis is the price ratio change from its initial values. So, where x=1, the relative price of the tokens has remained the same. Where x=2, the relative price of the tokens has doubled. Where x=0.5, the relative price of the tokens has halved (or, doubled in the opposite direction).
IL=2price_ratio/(1+price_ratio)1IL =2\sqrt{price\_ratio} / (1 + price\_ratio) -1
Note also that these calculations are the worst-case scenario – they assume that there are zero swap fees and zero incentive rewards throughout the duration of the deposit – so that the only factor determining returns is impermanent loss (which is never positive).
From here on, we'll refer to any points to the right of x=1 as when the DAO token increases in price relative to ETH. Points to the left of x=1 are when ETH increases in price relative to the DAO token. The Rift protocol can operate on arbitrary ERC20 tokens, but this will be pedagogically useful.

Rift Protocol

So, how does Rift manipulate this return profile to benefit both DAOs and Liquidity Providers given their respective goals from using the protocol? To calculate these return profiles, we do the following.
Let’s call the starting amount of ETH E_0, and the starting amount of DAO tokens G_0 (G for governance). Similarly, when a user withdraws their LP position, let’s call the ending amount of ETH E_1, and the ending amount of DAO tokens G_1.
Maintaining the standard from the graph above, let’s define x as the price ratio change from time 0 to time 1:
x:=E1G1E0G0=E1G0E0G1x := \frac{\frac{E_1}{G_1}}{\frac{E_0}{G_0}} = \frac{E_1G_0}{E_0G_1}
The constant product, k, is the product of reserves of the two tokens. At time t=0, we know:
k=E0G0k=E_0*G_0
Since we are assuming no swap fees or other rewards, we know that the constant product must remain the same from time 0 to time 1, according to the standard rules for a constant product AMM. This gives us the following equation.
k:=E0G0=E1G1k:=E_{0}\cdot G_{0}=E_{1}\cdot G_{1}
Combining the last two definitions, we can derive the amount of ETH and DAO tokens available upon withdrawal from the LP position, represented by the formula below. Derivation is left as an exercise for the reader.
E1=xE0G1=1xG0E_{1}=\sqrt{x}\cdot E_{0} \\ G_{1}=\frac{1}{\sqrt{x}}\cdot G_{0}
For simplicity, we can actually assume that:
E0=1,G0=1E_{0}=1, G_{0}=1
We can make this assumption without loss of generality because impermanent loss only cares about the price ratio change between time 0 and time 1, and not about the absolute prices between those two times. This ensures the validity of the next few formulas.
Working with this assumption, we can now define the “base profits” for each side – i.e. the absolute returns upon immediate withdrawal from the LP position.
Ebp=E1E0Gbp=G1G0E_{bp}=E_{1}-E_{0} \\ G_{bp}=G_{1}-G_{0}
Now that we know how much of each token the LP position returns upon immediate withdrawal, we can determine how much must be swapped to either side based on the interest rate floor and ceiling of 0. si stands for “swap in”.
Esi={x10x>1min(Gbpx,Ebp)}Gsi={x1min(Ebp1x,G1)x>10)}E_{si}=\left\{\begin{array}{ll}x\le1 & 0 \\x>1 &\min\left(-G_{bp}\cdot x,E_{bp}\right)\end{array}\right\} \\ \\ G_{si}=\left\{\begin{array}{ll}x\le1 & \min\left(-E_{bp}\cdot \frac{1}{x},G_{1}\right) \\x>1 & 0)\end{array}\right\}
Now that we know swap amounts, we can calculate how much of each side is received from the swap (”swap out”).
Eso=GsixGso=Esi1xE_{so}=G_{si}\cdot x \\ G_{so}=E_{si}\cdot\frac{1}{x}
We sum the initial amount received from the position with amounts swapped in and out. This determines the absolute returns of the position.
Era=E1Esi+EsoGra=G1Gsi+GsoE_{ra}=E_{1}-E_{si}+E_{so} \\ G_{ra}=G_{1}-G_{si}+G_{so}
And the final returns:
Er=EraE01Gr=GraG01E_{r}=\frac{E_{ra}}{E_{0}}-1 \\ G_{r}=\frac{G_{ra}}{G_{0}}-1
Assuming our base parameters of the interest rate floor and ceiling, we can now plug in these formulas and view how impermanent loss is distributed for the LP. Below, the blue line represents the standard impermanent loss profile for a Uni V2 position, while the orange line represents that of an LP who deposits via Rift.
Blue is the standard impermanent loss experience by liquidity providers in AMMs. Orange is the reduced impermanent loss experienced by LPs in the Rift Protocol.
As we can see, Rift LPs (ETH depositors) receive impermanent loss protection.
When the price of the governance token increases vs ETH (x>1), the ratio of assets in the pool has been skewed such that there are now fewer DAO tokens and more ETH in the LP position. In this scenario, the excess ETH in the position is swapped for governance tokens to pay back the DAO and make their position whole, never going below the LPs initial deposit.
When the price of the governance token decreases vs ETH (x<1), the ratio of assets in the pool has been skewed such that there are now more DAO tokens and fewer ETH in the LP position. In this scenario, the excess governance tokens are swapped for ETH to make the liquidity providers whole.
Now we can add in the return profile for DAOs.
Blue: Standard IL; Orange: IL for LPs in Rift; Green: IL for DAOs in Rift
This graph and these calculations assume there are no swap fees or other rewards; however, if swap fees outweigh IL, then any excess ETH is retained as profits for LPs.
All of these graphs can be viewed at the following Desmos link: https://www.desmos.com/calculator/taxabsbugg