# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ferra.ag/integration/dlmm/typescript-sdk/trading-pairs/get-single-pair.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
