updateCollateral() with a positive amount to top up and a negative amount to remove.
Important behavior
- top-ups check USDC allowance
- insufficient allowance throws
ALLOWANCE_INSUFFICIENT - removing collateral increases effective leverage
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Add or remove position collateral on Ostium with the Builder SDK.
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' });
ALLOWANCE_INSUFFICIENT