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

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

Parameters

  • positionId: The object ID of the position NFT

Returns

LBPosition object:

Understanding Position Data

NFT Metadata

Token Information

Complete Position Analysis

Error Handling

Verify Position Ownership

Position State Checks

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

Last updated