Retrieve clmm pools

1. Retrieve all pools

Method: sdk.Pool.getPoolsWithPage()

Params:

  • assignPools: An array of pool IDs to get. If you want to retrieve all pools, just pass an empty array.

Example

async function retrievelAllPools() {
  // If you want to get all pools, just pass one empty array.
  const pools = await TestnetSDK.Pool.getPoolsWithPage([])
  console.log(`pool length: ${pools.length}`)
}

// retrievelAllPools()
//pool length: 82

2. Batch retrieval of pools

Method: sdk.Pool.getPoolsWithPage()

Params:

  • assignPools: An array of pool IDs to get. If you want to retrieve all pools, just pass an empty array, otherwise pass an array not null.

Example

3. Retrieve one pool

Method: sdk.Pool.getPool()

Params:

  • poolID:pool address

  • forceRefresh: if refresh in cache.

Example

4. Retrieve one pool by coin types and fee rate

Method: sdk.Pool.getPoolByCoins()

Params:

  • coinTypes:coin types array.

  • feeRate(Option): fee rate number.

Example

Last updated