On Chain Registry
Last updated
Last updated
Stores a registry of Balancer 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 exectured entirely on-chain.
addPoolPair
addPoolPair(address pool, address token1, address token2)
Adds a single pool address for token pair.
addPools
addPools(address[] calldata pools, address token1, address token2)
Adds an array of pool addresses for token pair.
sortPools
sortPools(address[] calldata tokens, uint256 lengthLimit)
Sorts pools in order of liquidity. lengthLimit can be used to limit the number of pools sorted.
sortPoolsWithPurge
sortPoolsWithPurge(address[] calldata tokens, uint256 lengthLimit)
Sorts pools in order of liquidity and removes any pools with <10% of total liquidity.
getBestPools
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
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
getPoolsWithLimit(address fromToken, address destToken, uint256 offset, uint256 limit)
Retrieve array of pool addresses using an offset starting position.