Skip to main content
Use updateCollateral() with a positive amount to top up and a negative amount to remove.
await client.updateCollateral({ pairId, idx, amount: '50' });
await client.updateCollateral({ pairId, idx, amount: '-25' });

Important behavior

  • top-ups check USDC allowance
  • insufficient allowance throws ALLOWANCE_INSUFFICIENT
  • removing collateral increases effective leverage