Get clmm pools

1. Get all pools

use sdk.Pool.getPoolsWithPage() method

Function input params

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

Example

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

// getAllPools()
//pool length: 82

2. Batch get pools

use sdk.Pool.getPoolsWithPage() method

Function input params

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

Example

3. Get one pool

use sdk.Pool.getPool() method

Function input params

  • poolID:pool address

  • forceRefresh: if refresh in cache.

Example

4. Get one pool by coin types and fee rate

use sdk.Pool.getPoolByCoins() method

Function input params

  • coinTypes:coin types array.

  • feeRate(Option): fee rate number.

Example

Last updated