Get All Pairs

Get All Pairs

Discover all available DLMM trading pairs deployed on the network. This method fetches the complete list of pair contracts with their current configuration and state.

Prerequisites

Before fetching pairs:

  • Initialize the SDK with network connection

  • Ensure RPC endpoint is accessible

  • Understand LBPair data structure

Basic Usage

// Fetch all pairs from the network
const allPairs = await sdk.Pair.getPairs();

console.log(`Total pairs found: ${allPairs.length}`);

// Access pair data
allPairs.forEach(pair => {
  console.log({
    pairId: pair.id,
    tokenX: pair.tokenXType,
    tokenY: pair.tokenYType,
    activeId: pair.parameters.active_id,
    binStep: pair.binStep
  });
});

Method Details

Returns an array of all LBPair objects containing:

  • Pair configuration (tokens, bin step)

  • Current state (reserves, active bin)

  • Manager addresses (bins, positions)

  • Fee parameters

Understanding the Response

Each pair in the array contains:

Practical Examples

Find Specific Token Pairs

Check Pair Activity

Group by Bin Step

Performance Considerations

  • First call may take longer due to network fetching

  • Returns all pairs in a single response (no pagination)

  • Consider caching results for repeated access

  • Large deployments may have significant response size

Common Use Cases

  1. Market Discovery: Find available trading opportunities

  2. Liquidity Analysis: Identify pairs with sufficient depth

  3. Pair Selection: Choose optimal pairs for trading strategies

  4. Network Overview: Monitor total market deployment

Last updated