Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ostium.com/llms.txt

Use this file to discover all available pages before exploring further.

const { pairPositions, marginSummary, withdrawable } =
  await client.getOpenPositions();
In read-only mode:
await client.getOpenPositions({ user: '0xTraderAddress' });
The returned pairId and idx values are used by position-management methods.

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;
  };
  withdrawable: string;
  time: number;
}