Create clmm pool
Everyone can create cetus clmm pools directly.
1. Create a clmm pool with some initial liquidity to be added
sdk.Pool.createPoolTransactionPayload()
Function input params
Please refer to the original function for specific parameter types.
tick_spacing: tick spacing will affect price precision. Now mainnet exist some different type tick_spacing, they correspond to different fee rates.tick spacingfee rate2
0.0001
10
0.0005
20
0.001
60
0.0025
200
0.01
220
0.02
initialize_sqrt_price: for computational convenience, we use fixed-point numbers to represent square root prices. Use the provided by the SDK transformationpricetosqrtPrice:TickMath.priceToSqrtPriceX64().uri: the icon of pool, it's allows null.coin_type_a: the coin type address about coinA.coin_type_b: the coin type address about coinB.
Example
amount_a: the amount about coin A, which used to add liquidity.amount_b: the amount about coin B, which used to add liquidity.Notice: amount a and b was calculated by
ClmmPoolUtil.estLiquidityAndcoinAmountFromOneAmounts(), it will affected by selected tick interval、amount about one fixed coin(coinA or coinB)、current sqrt price of pool and allowed price slippage. You can see the usage in the next example.fix_amount_a:truemeans fixed coinA amount,falsemeans fixed coinB amount.tick_lower: Represents the index of the lower tick boundary.tick_upper: Represents the index of the upper tick boundary.
metadataA:The coin metadata id of the coin a.metadataB:The coin metadata id of the coin b.
Example
Last updated