Skip to main content
await client.closeTrade({
  pairId,
  idx,
  price: '66000',
  closePercent: 100,
});
For a partial close:
await client.closeTrade({
  pairId,
  idx,
  price: '66000',
  closePercent: 50,
});

Response schema

interface Response {
  txHash: `0x${string}`;
  smartAccountAddress?: `0x${string}`;
}