getOpenPositions() to fetch current positions and the pairId / idx values needed for management calls.
closeTrade()modifyOrder()updateCollateral()
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Inspect live positions and the identifiers needed to manage them with the Ostium Builder SDK.
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);
closeTrade()modifyOrder()updateCollateral()