Manage collateral
Adjust margin to move leverage and liquidation price.
Add or remove collateral on an open position to change its leverage and liquidation price — without changing size.
Add collateral (reduce leverage)
curl -X POST $FLASH_API_URL/transaction-builder/add-collateral -d '{
"marketSymbol": "SOL", "side": "LONG",
"depositAmountUi": "50.0", "depositTokenSymbol": "USDC", "owner": "<WALLET>"
}'The response includes existingLeverage → newLeverage and existingLiquidationPrice → newLiquidationPrice, plus maxAddableUsd.
Remove collateral (increase leverage)
curl -X POST $FLASH_API_URL/transaction-builder/remove-collateral -d '{
"marketSymbol": "SOL", "side": "LONG",
"withdrawAmountUsdUi": "25.00", "withdrawTokenSymbol": "USDC", "owner": "<WALLET>"
}'Returns receiveAmountUi and maxWithdrawableUsd alongside the new leverage / liq price.
Preview first
Check the resulting leverage and liquidation price before you commit:
curl -X POST $FLASH_API_URL/preview/margin -d '{
"marketSymbol": "SOL", "side": "LONG", "marginDeltaUsdUi": "50.00", "action": "ADD", "owner": "<WALLET>"
}'→ Preview fees & PnL · Full fields: API reference › Trading › Collateral
Both builders submit to the v2 RPC.
Last updated
Was this helpful?

