Skip to main content

Unified Margin Overview

Unified Margin (a.k.a. Portfolio Margin) is an opt-in account mode in which all of a user's open positions share a single margin pool. Offsetting positions (e.g. BTC long + ETH short) reduce the total margin requirement, improving capital efficiency.

A user is in exactly one mode at any time. Switching is explicit and has hard preconditions (see Switch Margin Mode).

Isolated (default)Unified
CollateralPer-positionSingle account-wide pool
Risk metricPer-position margin ratioAccount-level uniMMR
LiquidationPosition-by-positionCross-position waterfall
Best forSimple directional tradesHedged / multi-leg strategies

Key Concepts

uniMMR (Unified Maintenance Margin Ratio)

The single number that describes the health of a unified account:

uniMMR = total_equity / total_maintenance_margin
  • total_equity = wallet_balance + Σ unrealized_pnl − Σ accumulated_fees
  • total_maintenance_margin = Σ MM_per_position

When an account has no open positions uniMMR is null and the account is treated as safe.

Status machine

The backend risk worker evaluates every unified account every 2 s and transitions the account through the following ladder:

RangeStatusSide-effects
uniMMR > 2.00 or no positionsnormal
uniMMR ≤ 2.00warning_1Margin-call WS push
uniMMR ≤ 1.50warning_2Second margin-call
uniMMR ≤ 1.20reduce_onlyAll open orders auto-cancelled; new opening orders rejected
uniMMR ≤ 1.05liquidatingForced liquidation engine fires — one position per tick, starting from the worst-PnL

Status can recover automatically when uniMMR rises back above a threshold (except during an ongoing liquidation tick).

Tiered maintenance margin

Maintenance margin is computed per position using a symbol-specific tier table. A tier is a notional range with its own maint_margin_rate and a cumulative deduction that keeps the ladder continuous:

MM_position = notional × maint_margin_rate − cum_amount

The default ladder (applied when a symbol has no explicit tiers):

TierNotional cap (USD)MMRMax leverage
150,0000.40%125×
2250,0000.50%100×
31,000,0001.00%50×
45,000,0002.50%20×
520,000,0005.00%10×
650,000,00010.00%
7100,000,00012.50%
8200,000,00015.00%

Order gate

When a user in unified mode submits a new opening order, the server simulates the post-fill uniMMR. The order is rejected if:

  • Account status is reduce_only or liquidating, OR
  • available_balance − new_initial_margin < 0, OR
  • simulated_uniMMR < 1.10

Reducing / closing orders bypass the check.

Endpoint Map

MethodPathPurpose
POST/api/v1/account/margin-modeSwitch mode
GET/api/v1/unified/accountAccount snapshot
POST/api/v1/unified/risk/simulatePre-trade simulation
GET/api/v1/unified/liquidationsLiquidation history
WSchannel unified_accountLive push

All endpoints live under the standard https://api.ztdx.io host and require the same HMAC-SHA256 / JWT authentication as the rest of the /api/v1/* namespace.