Lesson 16 - Changes in Liquidity

px=yx=ynewxnew=y+Δyx+Δx
px(x+Δx)=y+Δy
yx(x+Δx)=y+Δy
y+yΔxx=y+Δy
Δy=yΔxx

Liquidity changes the invariant:

xnewynew=knew
(x+Δx)(y+Δy)=knew
xy+xΔy+yΔx+ΔxΔy=knew
k+xΔy+yΔx+ΔxΔy=knew

Minting or burning of pool shares:

For Uniswap 2, this is the formula for the initial pool shares:

initialpoolshares=initialTokenYinitialTokenY
Sp=x0y0

Once the pool exists, the change in share pools as liquidity is added:

ΔSpSp=Δxx

Snew=Sp+ΔSp=Sp+SpΔxx

Agent shares then are the additional shares the agent receives of the total Shares, proportional to the amount contributed.

This is the same the amount of additional Pool Shares minted to accomodate the increased liquidity:

newAP=AP+SpΔxx