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.

Use getOpenPositions() to fetch current positions and the pairId / idx values needed for management calls.
const { pairPositions, marginSummary, withdrawable } =
  await client.getOpenPositions();

for (const { position } of pairPositions) {
  console.log(
    position.pairId,
    position.idx,
    position.side,
    position.entryPx,
    position.unrealizedPnl,
    position.liquidationPx,
  );
}

console.log(marginSummary.accountValue, withdrawable);
Use these identifiers with:
  • closeTrade()
  • modifyOrder()
  • updateCollateral()