Get User Positions

List all DLMM position NFTs owned by a specific address, with optional filtering by trading pairs. This method helps track and manage your liquidity portfolio across multiple pools.

Prerequisites

Before fetching positions:

  • Set valid sender address in SDK

  • Understand position NFT structure

  • Know pair IDs for filtering (optional)

Basic Usage

// Set the address to query
sdk.senderAddress = "0x123...";

// Fetch all positions for the address
const positions = await sdk.Position.getLbPositions([]);

console.log(`Found ${positions.length} positions`);

// Display position details
positions.forEach(position => {
  console.log({
    positionId: position.id,
    pairId: position.pair_id,
    name: position.name,
    description: position.description
  });
});

Method Signature

Parameters

  • pairIds: Array of pair addresses to filter by (empty array returns all)

Returns

Array of LBPosition objects:

Filtering Positions

By Specific Pairs

By Token Types

Getting Position Details

Portfolio Analysis

Check Position Status

Common Use Cases

  1. Portfolio Dashboard: Display all user positions

  2. Position Management: Find positions to add/remove liquidity

  3. Fee Collection: Identify positions with claimable fees

  4. Performance Tracking: Monitor position returns across pairs

Performance Notes

  • Fetches all positions owned by the address

  • Uses efficient pagination internally

  • Filtered results are processed client-side

  • Consider caching for frequent queries

Error Handling

Last updated