Get Pair Bins
Prerequisites
Basic Usage
// First, get the pair
const pair = await sdk.Pair.getPair(pairAddress);
// Fetch bins around the active bin
const activeId = pair.parameters.active_id;
const bins = await sdk.Pair.getPairBins(
pair,
[activeId - 10, activeId + 10] // 20 bins range
);
// Display bin reserves
bins.forEach((bin, index) => {
const binId = activeId - 10 + index;
console.log(`Bin ${binId}:`, {
reserveX: bin.reserve_x.toString(),
reserveY: bin.reserve_y.toString()
});
});Method Signature
Parameters
Returns
Understanding Bin Ranges
Practical Examples
Analyze Liquidity Depth
Find Liquidity Walls
Display Price Levels
Performance Notes
Common Use Cases
Related Topics
Last updated