Balancer V1
Discord
  • Home
  • Getting Started
    • Use Cases
    • FAQ
  • Core Concepts
    • Protocol
      • Background
      • Glossary
      • Pool Lifecycle
      • Limitations
      • Math
        • Exponentiation
    • BAL Governance Token
      • BAL for Gas
    • Liquidity Mining
      • Exchange and BAL Mining Listing
      • Liquidity Mining Estimates API
    • Security
      • Audits
      • Bug Bounty
  • Smart Contracts
    • Exchange Proxy
    • Smart Order Router
      • Development & Examples
    • Smart Pools
      • Overview
      • Configurable Rights Pool
      • Component Libraries
        • Rights Manager
      • Smart Pool Templates
      • Liquidity Bootstrapping FAQ
    • On Chain Registry
    • Interfaces
    • Addresses
  • API
    • Migration to Version 1.0
    • Events
    • API Index
    • UML Docs
  • Guides
    • Interact via Etherscan
    • Using the SOR
    • Creating a Shared Pool
    • Creating a Smart Pool
    • CRP Tutorial
      • Liquidity Bootstrapping Example
    • Smart Pool Use Cases
      • Liquidity Bootstrapping Pool
      • Swing Trading Pool
      • Smart Treasury
      • Perpetual Synthetic Pool
      • Investors' Club
      • Experimental
    • Testing on Kovan
    • Hackathons
      • Hacking & Testing
      • Judging
      • Ideas
Powered by GitBook
On this page
  • This page has been deprecated. V1 documentation is partially maintained here
  • On Chain Registry
  • Summary
  • API
  1. Smart Contracts

On Chain Registry

PreviousLiquidity Bootstrapping FAQNextInterfaces

Last updated 3 years ago

This page has been deprecated. V1 documentation is partially maintained

On Chain Registry

Summary

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.

API

Adding Pools To Registry

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.

Sorting Pools

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.

Retrieving Pools

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.

here
Exchange Proxy