For the complete documentation index, see llms.txt. This page is also available as Markdown.

POST /account/margin

Add or remove isolated margin on an open position

Add or remove isolated margin on an open position.

operationId: adjustMargin

Authentication: hmacAuth.

Request body

Required. application/json. The contract declares no schema for this body — only the example below, so a generated client gets an untyped body here.

{
  "market_id": "BTC-USDX-PERP",
  "amount": "100",
  "direction": "add"
}

Responses

Status
Body
Meaning

200

(no schema declared)

Updated allocated margin and account collateral after the adjustment.

400

(no schema declared)

Invalid amount, position not in isolated mode (MarginModeNotIsolated), or removal breaches the withdrawal floor / exceeds collateral (InsufficientMargin / InsufficientBalance).

401

(no schema declared)

403

(no schema declared)

404

(no schema declared)

No open position for the account in this market (NoOpenPosition).

429

(no schema declared)

Example

X-Signature is a placeholder: it is derived from this specific request. See Authentication for the canonical string and the HMAC rule.


Generated from eng/apps/exchange/api/openapi.json (spec 0.9.36). Do not edit by hand — regenerate with python3 product/docs/tools/api-reference/generate.py. Hand-authored context lives in the Guides pages.

Last updated