diff --git a/x/market/keeper/msg_server_create_pool.go b/x/market/keeper/msg_server_create_pool.go index c69f1e1..d8ab39f 100644 --- a/x/market/keeper/msg_server_create_pool.go +++ b/x/market/keeper/msg_server_create_pool.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "math/big" "strings" sdk "github.com/cosmos/cosmos-sdk/types" @@ -62,7 +63,13 @@ func (k msgServer) CreatePool(goCtx context.Context, msg *types.MsgCreatePool) ( } // Drops define proportional ownership to the liquidity in the pool - drops := coinPair.AmountOf(denom1).Mul(coinPair.AmountOf(denom2)) + // Constant Product Model + // f(x, y) = value of liquidity + // We will define f(x, y) = sqrt(xy) + // InitDrops = Sqrt(denom1.Amount * denom2.Amount) + tmp := big.NewInt(0) + tmp.Sqrt((coinPair.AmountOf(denom1).Mul(coinPair.AmountOf(denom2))).BigInt()) + drops := sdk.NewIntFromBigInt(tmp) leader := types.Leader{ Address: msg.Creator,