Get Pair Reserves
Prerequisites
Basic Usage
// Get pair first
const pair = await sdk.Pair.getPair(pairAddress);
// Fetch all bin reserves
const reserves = await sdk.Pair.getPairReserves(pair);
console.log(`Total bins with liquidity: ${reserves.length}`);
// Display first few bins
reserves.slice(0, 5).forEach(bin => {
console.log(`Bin ${bin.id}:`, {
reserveX: bin.reserve_x.toString(),
reserveY: bin.reserve_y.toString(),
feeX: bin.fee_x.toString(),
feeY: bin.fee_y.toString()
});
});Method Signature
Returns
Understanding the Data
Reserves vs Fees
Practical Examples
Calculate Total Value Locked (TVL)
Find Liquidity Distribution
Analyze Fee Generation
Create Liquidity Heatmap Data
Performance Considerations
Differences from getPairBins
Feature
getPairReserves
getPairBins
Related Topics
Last updated