updateIsolatedMargin action lets you add or remove collateral from an existing isolated position without closing or modifying the position itself. Funds are simply moved between your cross margin pool and the isolated position — your total account balance stays constant.
This action uses full field names (
asset, isBuy, ntli) rather than the compact single-character keys used by order and cancel actions.How margin transfer works
Adding margin (ntli > 0): the specified amount is deducted from your cross available margin and credited to the isolated position’s margin balance. The operation is limited by how much cross margin is currently available.
Removing margin (ntli < 0): the specified amount is deducted from the isolated position’s margin balance and returned to your cross pool. After the removal, the remaining isolated equity must still be sufficient to cover the position’s initial margin requirement — you cannot remove margin to the point where your isolated position would be under-margined.
Endpoint
Request
All requests must include an ECDSA signature and a millisecond-precision nonce.Action fields
string
required
Fixed value:
"updateIsolatedMargin".int32
required
The contract ID of the position you want to adjust margin for.
boolean
Identifies the position side in hedge mode:
true = LONG position, false = SHORT position. Omit this field when your account is in ONE_WAY position mode.int64
required
Net transfer amount expressed in the collateral’s minimum units. Positive values add margin to the isolated position; negative values remove margin. Must not be
0.Response
Success
Rejection
Rejections still return HTTP 200 with
status: "ok". Check for the presence of errorCode in data to detect failures.Response fields
int64
The isolated position margin balance before the operation. Returns
0 on rejection.int64
The isolated position margin balance after the operation. Returns
0 on rejection.int
Present only on rejection. Identifies the failure reason.
string
Present only on rejection. Human-readable description of the failure.