# Get Single Position

Fetch comprehensive data for a specific position NFT including metadata, associated pair information, and token types. This method retrieves the on-chain position object with all its properties.

### Prerequisites

Before fetching position data:

* Have a valid position ID (object address)
* Initialize the SDK with network connection
* Understand position NFT structure in DLMM

### Basic Usage

```typescript
const positionId = "0x123...abc";

// Fetch position details
const position = await sdk.Position.getLbPosition(positionId);

console.log("Position details:", {
  id: position.id,
  pairId: position.pair_id,
  tokenX: position.tokenXType,
  tokenY: position.tokenYType,
  name: position.name
});
```

### Method Signature

```typescript
async getLbPosition(positionId: string): Promise<LBPosition>
```

#### Parameters

* `positionId`: The object ID of the position NFT

#### Returns

`LBPosition` object:

```typescript
interface LBPosition {
  id: string;              // Position NFT address
  tokenXType: string;      // Full type of token X
  tokenYType: string;      // Full type of token Y
  pair_id: string;         // Associated pair address
  name: string;            // NFT name (e.g., "Alphafi DLMM Position")
  description: string;     // NFT description
  url: string;             // NFT image URL
  index: string;           // Position index in the pair
  version: string;         // Object version
}
```

### Understanding Position Data

#### NFT Metadata

```typescript
const position = await sdk.Position.getLbPosition(positionId);

// NFT display properties
console.log("NFT Name:", position.name);
console.log("Description:", position.description);
console.log("Image URL:", position.url);

// Position specifics
console.log("Position Index:", position.index);
console.log("Pair ID:", position.pair_id);
```

#### Token Information

```typescript
const position = await sdk.Position.getLbPosition(positionId);

// Extract token symbols from types
const tokenXSymbol = position.tokenXType.split("::").pop();
const tokenYSymbol = position.tokenYType.split("::").pop();

console.log(`Position holds: ${tokenXSymbol}/${tokenYSymbol}`);
```

### Complete Position Analysis

```typescript
// Get position and its associated data
const positionId = "0x123...";
const position = await sdk.Position.getLbPosition(positionId);

// Get the pair for additional context
const pair = await sdk.Pair.getPair(position.pair_id);

// Get bins to see liquidity distribution
const bins = await sdk.Position.getPositionBins(pair, positionId);

// Get current value
const amounts = await sdk.Position.getPositionBinsAmount(pair, positionId);

console.log("Position analysis:", {
  pair: `${position.tokenXType}/${position.tokenYType}`,
  activeBins: bins.length,
  binRange: bins.length > 0 ? [bins[0].id, bins[bins.length - 1].id] : [],
  currentPrice: getPriceFromBinId(pair.parameters.active_id, Number(pair.binStep))
});
```

### Error Handling

```typescript
try {
  const position = await sdk.Position.getLbPosition(invalidId);
} catch (error) {
  if (error.message.includes("Position not found")) {
    console.error("Position does not exist");
  } else if (error.message.includes("Invalid")) {
    console.error("Invalid position ID format");
  }
}
```

### Verify Position Ownership

```typescript
// Check if position belongs to current user
const position = await sdk.Position.getLbPosition(positionId);
const userPositions = await sdk.Position.getLbPositions([]);

const isOwner = userPositions.some(p => p.id === positionId);
console.log("User owns this position:", isOwner);
```

### Position State Checks

```typescript
const position = await sdk.Position.getLbPosition(positionId);
const pair = await sdk.Pair.getPair(position.pair_id);

// Check if position has liquidity
const bins = await sdk.Position.getPositionBins(pair, positionId);
const hasLiquidity = bins.length > 0;

// Check if pair is still active
const pairActive = BigInt(pair.reserveX) > 0n || BigInt(pair.reserveY) > 0n;

console.log("Position state:", {
  hasLiquidity,
  pairActive,
  binCount: bins.length
});
```

### Common Use Cases

1. **Position Details Page**: Display complete position information
2. **Pre-transaction Validation**: Verify position before operations
3. **Position Migration**: Get data before moving to new strategies
4. **Analytics**: Track individual position performance

### Related Topics

* [Get User Positions](/integration/dlmm/typescript-sdk/position-management/get-user-positions.md) - List all user positions
* [Get Position Bins](/integration/dlmm/typescript-sdk/position-management/get-position-bins.md) - View liquidity in bins
* [Position Value](/integration/dlmm/typescript-sdk/fees-and-analytics/position-value.md) - Calculate position worth
* [Remove Liquidity Overview](/integration/dlmm/typescript-sdk/remove-liquidity/remove-liquidity-overview.md) - Withdraw from position


---

# 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/position-management/get-single-position.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.
