Skip to main content
// Connected wallet (default)
const { pairPositions, marginSummary } =
  await client.getOpenPositions();

// Specific trader (read-only mode)
await client.getOpenPositions({ user: '0xTraderAddress' });

// All traders — no user filter
await client.getOpenPositions({ user: 'ALL' });

// Paginated — first page of 50
await client.getOpenPositions({ user: 'ALL', limit: 50, skip: 0 });

// Paginated — second page
await client.getOpenPositions({ user: 'ALL', limit: 50, skip: 50 });
The returned pairId and idx values are used by position-management methods.

Parameters

ParameterTypeDefaultDescription
userAddress | 'ALL'connected walletTrader address to scope results to. Pass 'ALL' to fetch open positions across every trader (no trader filter applied).
blockNumberbigintcurrent blockArbitrum block number used for live PnL projection. Auto-fetched when using OstiumClient.
limitnumberInfinityMaximum number of positions to return.
skipnumber0Number of positions to skip — use with limit to paginate.

Response schema

interface Response {
  pairPositions: Array<{
    position: {
      pairTo: string;
      pairFrom: string;
      pairId: string;
      pid: string;
      idx: number;
      side: 'B' | 'S';
      szi: string;
      entryPx: string;
      leverage: string;
      ntl: string;
      unrealizedPnl: string;
      returnOnEquity: string;
      liquidationPx: string;
      collateralUsed: string;
      cumRollover: string;
      tpPx?: string;
      slPx?: string;
      openTimestamp: number;
      isDayTrade: boolean;
      maxLeverage: string;
      maxWithdrawable: string;
    };
  }>;
  marginSummary: {
    accountValue: string;
    totalCollateralUsed: string;
    totalNtlPos: string;
    totalRawPnlUsd: string;
    totalCumRollover: string;
    totalWithdrawable: string;
  };
  time: number;
}