v3

latestOpenAPI 3.0.3Apache 2.02026-08-0653305199.2 KB

Update Isolated Margin

Adjust the signed collateral allocation for an existing isolated position. Use a positive amount to add margin and a negative amount to remove it. A removal may include unrealized isolated profit, but the resulting isolated position equity (allocation + unrealized PnL - settled funding) must remain at or above the position's current required initial margin.

Both additions and removals are rejected while the account is in cross liquidation or the target isolated position is in isolated liquidation. An isolated liquidation on another instrument does not block this request.

Cancel-only mode does not gate margin adjustments.

Requires proxy signature, see proxy signing. Gateway signature validation rejects a stale or future-skewed timestamp as invalid signature. A request that passes gateway validation can still fail sequencer freshness revalidation with invalid_margin_signature_timestamp. Reusing the exact signed request rejects with signature_already_used.

patch/v1/trade/margin

Request body

sigstring required

Signature in hex format

saltinteger required

Salt

tsinteger required

Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).

Example request

{
  "op": {
    "args": {
      "iid": 1,
      "amt": "100.00"
    }
  },
  "sig": "0x1234567890...",
  "salt": 1234567890,
  "ts": 1767225600000
}

Response

Generic response.

OR

Example response

{
  "error": "insufficient_margin"
}