> For the complete documentation index, see [llms.txt](https://docs.ferra.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ferra.ag/integration/dlmm/typescript-sdk/trading-pairs/get-single-pair.md).

# Get Single Pair

Fetch comprehensive data for a specific DLMM trading pair including reserves, fees, and configuration.

### Prerequisites

Before fetching pair data:

* Have a valid pair address
* Initialize the SDK with network connection
* Understand basic pair structure and bins

### Basic Usage

```typescript
const pairAddress = "0x123...abc";
const pair = await sdk.Pair.getPair(pairAddress);

if (!pair) {
  console.log("Pair not found");
  return;
}

console.log("Active Bin ID:", pair.parameters.active_id);
console.log("Bin Step:", pair.binStep);
```

### Returned Data Structure

```typescript
interface LBPair {
  id: string;                    // Pair object address
  tokenXType: string;            // Token X full type
  tokenYType: string;            // Token Y full type
  binStep: string;               // Basis points
  reserveX: string;              // Total X reserves
  reserveY: string;              // Total Y reserves
  
  parameters: {
    active_id: number;           // Current trading bin
    base_factor: string;         // Base fee factor
    protocol_share: string;      // Protocol fee %
    volatility_accumulator: string;
    // ... more fee parameters
  };
  
  binManager: string;            // Bins storage address
  positionManager: {
    id: string;                  // Positions storage
    total_supplies: string;      // Supply tracking
  };
}
```

### Common Usage Patterns

#### Check Pair Status

```typescript
const pair = await sdk.Pair.getPair(pairAddress);

// Calculate current price from active bin
const currentPrice = getPriceFromBinId(
  pair.parameters.active_id,
  Number(pair.binStep)
);

// Check liquidity depth
const hasLiquidity = BigInt(pair.reserveX) > 0n || 
                    BigInt(pair.reserveY) > 0n;
```

#### Monitor Pair Metrics

```typescript
// Get fee configuration
const baseFee = Number(pair.parameters.base_factor);
const protocolShare = Number(pair.parameters.protocol_share);

// Calculate TVL (simplified)
const tvl = calculateTVL(
  pair.reserveX, 
  pair.reserveY,
  currentPrice
);
```

### Error Handling

```typescript
try {
  const pair = await sdk.Pair.getPair(invalidAddress);
  if (!pair) {
    // Address valid but pair doesn't exist
    handlePairNotFound();
  }
} catch (error) {
  // Invalid address format
  console.error("Invalid pair address");
}
```

### Use Cases

* **Before Trading**: Check reserves and active bin
* **Analytics**: Monitor TVL and fee parameters
* **Position Management**: Get position manager address
* **Price Discovery**: Find current trading price

### Related Topics

* [Get All Pairs](/integration/dlmm/typescript-sdk/trading-pairs/get-all-pairs.md) - Discover available pairs
* [Get Pair Bins](/integration/dlmm/typescript-sdk/trading-pairs/get-pair-bins.md) - Detailed bin information
* [Get Pair Reserves](/integration/dlmm/typescript-sdk/trading-pairs/get-pair-reserves.md) - Liquidity distribution
* [Execute Swap](/integration/dlmm/typescript-sdk/swap-operations/execute-swap.md) - Trade on the pair
