Are 50/50 pools and xy=k constant product market maker equivalent?
Some people called Constant product market makers as 50/50 pools, but many do not know why the two are intrinsically linked. Today, the author will deduce the equivalence between the two from a mathematical point of view.
1. 50/50 pools to xy=k
Taking the pool ETH-USDT as an example, assuming that the value of tokenA(ETH) and tokenB(USDT) in the pool are always equal, and the reserve amount of tokenA is x and the reserve amount of tokenB is y, then the values of the two are equal:
y=px — — — — — — — — — — — — — — — — — —- — --( 1)
The exchange price is p, then p=-dy/dx — — — — — — (2)
Substitute (2) into (1) to have:
dy/dx=-y/x
dy/y=-dx/x
after integrating both sides, we get:
lny=-lnx+C
lny+lnx=C
ln(xy)=C
xy=e^C
That is, the general solution is
xy=k
2、xy=k to 50/50 pools
The reserve amount of ETH is x, and the reserve amount of USDT is y.
xy=k — — — — — — — — — — — — — — (3)
Then y=k/x — — — — — — — — — — — -(4)
After taking the derivative:
dy/dx = -k/x² — — — — — — — — — — -(5)
Substitute (3) into (5) to get
y=-xdy/dx=px
Therefore, the value of ETH and USDT are also equal. It should be noted here that dy/dx=-p is because the amount of one token increases for the pool, and the amount of another token must decrease, so the change of the token is equal to the negative of the price .
To sum up, 50/50 pool and xy=k are completely equivalent.