Get Elastic Pool Addresses
Uncover The Best Pools
Overview
For each token pair, there are possibly many multiple pools with different configurations. As such, it is necessary to specify which pools are to be used for fetching token rates, trade execution and liquidity provision.
Elastic SDK
KyberSwap has created an Elastic SDK to make interacting with our Elastic smart contracts easier. You can refer to our Elastic SDK Developer Guides for step-by-step walkthroughs on how to achieve various Elastic operations in a TypeScript environment.
Selecting the right pool
KyberSwap Elastic contract provides a function to get a specific pool. For each inputs including tokenIn
, tokenOut
, fee
there will be an exact pool.
The input fee parameter can be:
8
in BPS ~ 0.008%10
in BPS ~ 0.01%40
in BPS ~ 0.04%300
in BPS ~ 0.3%1000
in BPS ~ 1%
getPool()
getPool()
Returns the pool address for a given pair of tokens and a swap fee. Note that the token order does not matter.
Input
Field | Type | Explanation |
---|---|---|
|
| contract address of either token0 or token1 |
|
| contract address of the other token |
|
| swap fee, in basis points |
Output
Field | Type | Explanation |
---|---|---|
|
| The pool address. Returns null address if it does not exist |
Last updated