On Chain Registry
Last updated
Was this helpful?
Last updated
Was this helpful?
Stores a registry of Bunicorn Flexible Pool addresses for a given token address pair. Pools can be sorted in order of liquidity and queried via view functions. Used in combination with the swaps can be sourced and executed entirely on-chain.
addPoolPair(address pool, address token1, address token2)
Adds a single pool address for token pair.
addPools(address[] calldata pools, address token1, address token2)
Adds an array of pool addresses for token pair.
sortPools(address[] calldata tokens, uint256 lengthLimit)
Sorts pools in order of liquidity. lengthLimit can be used to limit the number of pools sorted.
sortPoolsWithPurge(address[] calldata tokens, uint256 lengthLimit)
Sorts pools in order of liquidity and removes any pools with <10% of total liquidity.
getBestPools(address fromToken, address destToken)
Retrieve array of pool addresses for token pair. Ordered by liquidity if previously sorted. Max of 32 pools returned.
getBestPoolsWithLimit(address fromToken, address destToken, uint256 limit)
Retrieve array of pool addresses for token pair. Ordered by liquidity if previously sorted. Max of n pools returned where n=limit.
getPoolsWithLimit(address fromToken, address destToken, uint256 offset, uint256 limit)
Retrieve array of pool addresses using an offset starting position.