Create Pool

1. Create Pool

1.1. Function params

  • account: the signer of user,

  • metadata_a: the metadate of coin pair_a object

  • metadata_b: the metadate of coin pair_a object

  • tick_spacing: the tick spacing of pool, now can set 2, 10, 60, 200.

  • initialize_price: The clmmpool's initialize sqrt price.

  • uri: the pool icon.

1.2. Function

// tucana_clmm::router
public entry fun create_pool(
    account: &signer,
    metadata_a: Object<Metadata>, 
    metadata_b: Object<Metadata>,  // coin pair_a object address
    tick_spacing: u32, // 2, 10, 60, 200
    initialize_price: u128,
    uri: String
)

2. Create Pool With Liquidity

2.1 Function params

  • account: the signer of user,

  • metadata_a: the metadate of coin pair_a object

  • metadata_b: the metadate of coin pair_a object

  • tick_spacing: the tick spacing of pool, now can set 2, 10, 60, 200.

  • initialize_price: The clmmpool's initialize sqrt price.

  • uri: the pool icon.

  • tick_lower: the lower tick index for the pool.

  • tick_upper: the upper tick index for the pool.

  • amount_a: the amount of coin a will be remove.

  • amount_b: the amount of coin b will be remove.

  • fix_amount_a: if true, fix the amount of coin a, then remove liquidity. the amount of coin b will be auto calculate by amount a and position tick range and liquidity.

2.2. Function

// tucana_clmm::router
public entry fun create_pool_with_liquidity_with_all(
    account: &signer,
    metadata_a: Object<Metadata>,
    metadata_b: Object<Metadata>,
    tick_spacing: u32,
    initialize_price: u128,
    uri: String,
    tick_lower: u32,
    tick_upper: u32,
    amount_a: u64,
    amount_b: u64,
    fix_amount_a: bool,
) 

Last updated