LogoLogo
  • Introduction
    • Overview
    • Concepts
      • Decentralised Exchange (DEX)
      • Liquidity Pools
      • Swaps
      • Automated Market Maker (AMM)
      • Fees
  • Developers
    • Smart Contracts
      • Error Codes
      • Flash Loans
      • Internal User Balances
      • Pool Interface
    • Joins and Exits
      • Pool Joins
      • Pool Exits
    • Maths
      • Weighted Maths
    • Arbitrage System
      • Arbitrage Functions
    • Swaps
      • Single Swap
      • Batch Swaps
    • Arbitrage Profit Distributor
  • Resources
    • Code Licensing
    • Change Log
    • Glossary
    • Web3
    • Security & Audits
Powered by GitBook
On this page
  • Overview
  • poolIDs
  • Getting Common Pool Data
  1. Developers
  2. Smart Contracts

Pool Interface

PreviousInternal User BalancesNextJoins and Exits

Last updated 2 months ago

Overview

There are many different pool types in the A360 AMM, however all these pool types extend the and there is common interfacing capability across all the different pool types.

poolIDs

If you want to interface with a pool, you'll first need to know its poolId. The poolId is a unique identifier, the first portion of which is the pool's contract address. For example, the pool with the id 0x5c6ee304399dbdb9c8ef030ab642b10820db8f56000200000000000000000014 has a contract address of 0x5c6ee304399dbdb9c8ef030ab642b10820db8f56.

You can get a poolId from:

  • A pool's URL:

  • The

  • Calling getPoolId() on the contract itself if you already have it

Getting Common Pool Data

Below are the data fields common to all pools; however, each pool will have data specific to its pool type.

Pool Balances

Since all tokens are held in the Vault, you must query the Vault when querying on-chain pool balances. For example, calling

vault.getPoolTokens(0x5c6ee304399dbdb9c8ef030ab642b10820db8f56000200000000000000000014_

returns something resembling:

tokens:  [0xba100000625a3754423978a60c9317c58a424e3D,
                0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2]

balances:  [5720903090084350251216632,
                7939247003721636150710]

Swap Fee

Swap fees are stored at the pool level. To get a pool's swap fee, call:

pool.getSwapFeePercentage()

Values are returned with 18 decimals.

BasePool.sol
https://beta.privatepools.network/pools/details/0x62ad5b229d5d88b562d755c80b69f129e0ff3a4500010000000000000000000e/BNB/info
Subgraph