SaucerSwap offers a public REST API endpoint to retrieve all liquidity pools, accompanied by useful metadata for each pool, including liquidity pool reserves, and their associated tokens. Use the following URL options to access the data.
Data JSON Schema
interface ApiLiquidityPool {
id: number ;
contractId: string ;
lpToken: ApiLPToken;
lpTokenReserve: string ;
tokenA: ApiToken;
tokenReserveA: string ;
tokenB: ApiToken;
tokenReserveB: string ;
}
interface ApiLPToken {
decimals: number ;
id: string ;
name: string ;
symbol : string ;
priceUsd: string ;
}
interface ApiToken {
decimals: number ;
icon: string | null ;
id: string ;
name: string ;
price: string ;
priceUsd: number ;
symbol : string ;
dueDiligenceComplete: boolean ;
isFeeOnTransferToken: boolean ;
description: string | null ;
website: string | null ;
sentinelReport: string | null ;
twitterHandle: string | null ;
timestampSecondsLastListingChange: number ;
}
Code Overview
⛽ No gas cost
const url = 'https://api.saucerswap.finance/pools/' ;
const response = await axios. get ( url) ;
const pools = response. data;
for ( const pool of pools as ApiLiquidityPool[ ] ) {
const symbolA = pool. tokenA. symbol ;
const symbolB = pool. tokenB. symbol ;
let output = '' ;
output += ` Pool id: ${ pool. id} ` ;
output += ` - ${ poolcontractId} ( ${ symbolA} / ${ symbolB} ) ` ;
console . log ( output) ;
}