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 closeTrade() with the pairId and idx from getOpenPositions().
await client.closeTrade({
  pairId,
  idx,
  price: '66000',
  closePercent: 100,
});
Partial close:
await client.closeTrade({
  pairId,
  idx,
  price: '66000',
  closePercent: 50,
});