Adding Liquidity in BlueLotusDAO
Last updated
Last updated
There are some conditions when adding liquidity to the BlueLotusDAO:
After LP contributions, the token price is unchanged.
and are also unchanged after LP contributions.
In BlueLotusDAO, the pool for pair X-Y needs to maintain 4 parameters:
The initial amount of token that is used for amplification, denoted by
The initial amount of token that is used for amplification, denoted by
The change in token amount after trading activities, denoted by
The change in token amount after trading activities, denoted by
Therefore, the real balances and virtual balances of the reserves are:
Real Balances
Virtual Balances
The real balances and virtual balances of the reserve after contribution are:
Real Balances
Virtual Balances
The constant product, after the LP contribution, becomes:
Suppose an LP wants to contribute 20% of the current token amounts in the pool, so he should deposit:
ie. deposit 24X and 17Y tokens.
where is the amplification factor. You may find more information about the amplification factor here.
The constant product .
Note that and at this time are:
The current price:
Liquidity Providers have to contribute in the same proportion for all 4 amount types. We denote the contribution ratio to be . LPs have to contribute , in which:
and at this time are:
The current price is updated to be
We see that after LP contributes, the current price, and are unchanged. It is similar in the case of LPs withdrawals, where the ratio is negative.
Initially, the first LP put 100 and 100 to the reserve, we have: .
A user trades 20 X for 15 Y, so we have the updated parameters: .
The parameters are then updated to be: , , , .