šVariation and Returns
Uniswap and similar protocols use the product of the reserves to determine quotes for traders. Fortunately, when calculating the square root of this product, the geometric mean, we can measure the growth of the LP reserves. Since liquidity shares from the pool increase only when LPs add additional liquidity to the pool, the growth of the geometric mean of the reserves due to trading fees belongs completely to LPs.
Therefore, assuming there is no change in the ratio of the reserves of the pool, the value of the LPs stake grows at an exponential rate from trading fees. Assuming the initial value of a LPs stake is and the geometric mean grows at a constant rate, Ī±, the total value at any time can be calculated as shown:
In which,
represents the growth rate of the LPs reserves from trading fees per unit of time
We assume an exponential function because we assume continuos compounding interest.
To calculate our return we must derive the previous equation and subtract 1:
Price Variation
As explained on Staking & Impermanent Loss, the position value at any point on time is given by the following equation:
Where is the value of the liquidity in the pool dependent on price, and and are the quantities of tokens X and Y, respectively, held in reserve. However, we do not want to have a function depending on those values. Hence, as stated on the Uniswap Whitepaper, we can assume that:
And, also, according to Related Pricing, the ratio of the two reserve quantities can be obtained by:
; therefore ;
Substituting the values of and into the equation for the geometric mean of the reserve quantities, we can derive:
Hence,
Therefore, using the original formula from Staking & Impermanent Lossin function of the previous equations we can obtain:
To derive the return of the stake in the LP on an initial time , i.e., the initial value of the liquidity stake is . Then calculate the return from :
The returns of the LP with respect to price variation move at a sublinear rate with respect to price. This relationship is obvious since the return grows as the square root of price. Calculating the first derivative with respect to price yields:
Last updated