Evolution of the price of a LP token

How can we relate the variation of the price of the WBNB-CAKE LP token to the variations of the prices of WBNB and CAKE?

This question is of central interest for a liquidity provider because his gain is the sum of the variation of the value of their WBNB-CAKE LP and rewards from providing liquidity.

We introduce the required notations: p0LPp^{\mathrm{LP}}_0is the initial price of the WBNB-CAKE LP token, while p1LPp^{\mathrm{LP}}_1 is the price at a given later time. Similarly we have notations ptWBNB,ptCAKE,p^{\mathrm{WBNB}}_t,p^{\mathrm{CAKE}}_t,xtWBNB,xtCAKEx^{\mathrm{WBNB}}_t,x^{\mathrm{CAKE}}_t for prices and quantities of both tokens at time t=0t = 0 and t=1t = 1.

Note that the quantity QQ of LP tokens may also vary with time as people add or remove liquidity. However this does not affect the value of each LP token, hence for simplicity we assume QQ is constant in what follows.

The price of the WBNB-CAKE LP token later in time is given by

p1LP=1/Q×(p1WBNB×x1WBNB+p1CAKE×x1CAKE).p^{\mathrm{LP}}_1=1/Q \times (p^{\mathrm{WBNB}}_1\times x^{\mathrm{WBNB}}_1 + p^{\mathrm{CAKE}}_1 \times x^{\mathrm{CAKE}}_1).

By the arbitrage-free formula at time t=1t=1 we have p1WBNB×x1WBNB=p1CAKE×x1CAKEp^{\mathrm{WBNB}}_1\times x^{\mathrm{WBNB}}_1= p^{\mathrm{CAKE}}_1 \times x^{\mathrm{CAKE}}_1, hence

p1LP=2/Q×p1WBNB×x1WBNB.p^{\mathrm{LP}}_1=2/Q \times p^{\mathrm{WBNB}}_1\times x^{\mathrm{WBNB}}_1.

We can relate x1WBNBx^{\mathrm{WBNB}}_1 to the tokens in the pool at the initial time t=0t=0 using the constant product rule x1WBNB×x1CAKE=x0WBNB×x0CAKEx_1^{\mathrm{WBNB}} \times x_1^{\mathrm{CAKE}}=x_0^{\mathrm{WBNB}} \times x_0^{\mathrm{CAKE}}, which yields:

x1WBNB×x1WBNB×p1WBNBp1CAKE=x0WBNB×x0CAKEx1WBNB=p1CAKEp1WBNB×x0WBNB×x0CAKE,x^{\mathrm{WBNB}}_1\times x^{\mathrm{WBNB}}_1 \times \frac{p_1^{\mathrm{WBNB}}}{ p_1^{\mathrm{CAKE}}}= x^{\mathrm{WBNB}}_0 \times x^{\mathrm{CAKE}}_0\\ \Rightarrow x^{\mathrm{WBNB}}_1= \sqrt{\frac{p_1^{\mathrm{CAKE}}}{ p_1^{\mathrm{WBNB}}}\times x^{\mathrm{WBNB}}_0 \times x^{\mathrm{CAKE}}_0},

so that

p1LP=2/Q×p1WBNB×p1CAKE×x0WBNB×x0CAKE.p^{\mathrm{LP}}_1=2/Q \times \sqrt{p^{\mathrm{WBNB}}_1 \times p_1^{\mathrm{CAKE}} \times x^{\mathrm{WBNB}}_0 \times x^{\mathrm{CAKE}}_0}.

We denote by r,s0r,s\geq 0 the variations of the prices of WBNB and CAKE, i.e. we have:

p1WBNB=r×p0WBNB        and        p1CAKE=s×p0CAKE.p_1^{\mathrm{WBNB}}= r \times p_0^{\mathrm{WBNB}}\;\;\;\;\text{and}\;\;\;\;p_1^{\mathrm{CAKE}}= s \times p_0^{\mathrm{CAKE}}.

We can then rewrite the price of the WBNB-CAKE LP token as

p1LP=2/Q×r×s×p0WBNB×p0CAKE×x0WBNB×x0CAKE.p^{\mathrm{LP}}_1=2/Q \times \sqrt{r \times s \times p^{\mathrm{WBNB}}_0 \times p_0^{\mathrm{CAKE}} \times x^{\mathrm{WBNB}}_0 \times x^{\mathrm{CAKE}}_0}.

However by the arbitrage-free formula at time t=0t=0 we have p0WBNB×x0WBNB=p0CAKE×x0CAKEp^{\mathrm{WBNB}}_0\times x^{\mathrm{WBNB}}_0= p^{\mathrm{CAKE}}_0 \times x^{\mathrm{CAKE}}_0, which implies that:

p1LP=2/Q×r×s×p0WBNB×x0WBNB.p^{\mathrm{LP}}_1=2/Q \times \sqrt{r \times s} \times p^{\mathrm{WBNB}}_0 \times x^{\mathrm{WBNB}}_0.

This leads to the beautiful formula relating the variation of the price of the LP token to that of the single tokens in the pool:

p1LP=r×s×p0LP.p^{\mathrm{LP}}_1 = \sqrt{r \times s }\times p^{\mathrm{LP}}_0.