I know a little bit about the Uniswap, providing liquidity, bonding curves…
But I'm still struggling to perform the actual math – what is the actual formula?
Real-life example (easier to operate on real numbers)
- Uniswap pool: https://uniswap.info/pair/0x2680a95fc9de215f1034f073185cc1f2a28b4107
- Bonding curve contract: https://etherscan.io/address/0x2680a95fc9de215f1034f073185cc1f2a28b4107
Situation
Round numbers:
- 300 ETH
- 300k GET
Say I'm a whale and I add 60 ETH
and 60k GET
to the bonding curve.
The bonding curve now:
- 360 ETH
- 360k GET
I have 20% of the liquidity pool.
Calculation
What will happen in cases 1 and 2?
-
Someone sends 10 ETH into the bonding curve?
-
Someone sends 10k GET into the bonding curve?
My understanding is that I will still own 20% of the liquidity pool but what about the actual numbers of ETH and GET?
Best Answer
As a liquidity provider, you cannot send money on either side of the pool, they need to be added in the same proportions.
However, someone is free to buy ETH/GET or buy GET/ETH from the pool. In this case the number of tokens left in the pool changes and the price moves using the following formula:
ETH/GET price before = 360/360k = 1000
For the case (1): bought 1000 GET with 10 ETH
ETH/GET new price = 350k/370 = 945
For the sake of simplification, I left of liquidity provider fees from the calculations.