SaucerSwap V1 Liquidity Operations Fetch All Pools Get all V1 liquidity pools via SaucerSwap REST API.
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
Typescript
Copy interface ApiLiquidityPool {
id : number ;
contractId : string ;
lpToken : ApiLPToken ;
lpTokenReserve : string ; //in smallest unit
tokenA : ApiToken ;
tokenReserveA : string ; //in smallest unit
tokenB : ApiToken ;
tokenReserveB : string ; //in smallest unit
}
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
Typescript
Copy 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);
}