client.api.collateral().getAssets() in TypeScript or http.collateral().get_assets() in Rust.
Available instructions
Deposit cbBTC
SendReallocTrader, create the custody ATA if needed, transfer the SPL tokens into it, and call SyncSpot in that order in one transaction. Each asset uses a separate trader map entry. SyncSpot credits the balance up to the per-trader and exchange-wide caps. If some tokens remain in custody above those limits, they carry no margin value until a later sync credits them. Read the accounted balance again after confirmation.
The Solana cbBTC mint is cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij. It uses 8 decimals, so 0.01 cbBTC is 1,000,000 base units.
TypeScript
traderCapacityPrepared: true to buildSpotDepositFlow.
In Rust, build the same sequence with create_realloc_trader_ix, the SPL associated token account and transfer instructions, and create_sync_spot_ix with the cbBTC mint. Use the custody ATA for the trader’s wallet PDA as the token transfer destination.
Compute margin using API data
Use the SDK margin calculation. In TypeScript, pass
resource.marginInputs() to the calculator returned by MarginMarketParamsStore.getCalculator(). In Rust, load exchange metadata and market prices before calling to_trader_portfolio_with_metadata(&metadata) and compute_margin(&metadata). Both paths use discounted cbBTC value for effective collateral and the full index-price value for portfolio value.