Skip to main content
OCX enforces margin server-side. Every order passes a margin check before it is accepted, and open positions are monitored continuously. This page explains those mechanics conceptually — the exact model parameters are internal, but the behavior you need to trade safely is described here.

Portfolio margin

OCX uses portfolio margin: rather than charging margin position-by-position in isolation, it evaluates your positions together and recognizes offsetting risk. A hedged book (positions that partly cancel each other’s risk) requires less margin than the same positions would if margined separately. Two levels matter:

Initial margin

The collateral required to open a position. Checked at order time — an order that would leave you under-collateralized is rejected.

Maintenance margin

The minimum collateral required to keep a position open. Falling below it puts the position at risk of liquidation.
Margin is drawn from the relevant venue bucket — perps for perpetuals and futures, options for options. Fund the bucket for the venue you trade in. See Balances & transfers.
Because the margin check runs at order acceptance, a preview call (/perps/orders/preview) is the reliable way to see the margin required and whether an order will be approved before you send it.

What triggers a liquidation

Your positions carry unrealized profit and loss as the mark price moves. When adverse price movement (or accruing funding on perps) erodes your collateral so that your account can no longer meet maintenance margin, the position becomes eligible for liquidation.
1

Margin erodes

Losses, funding payments, or increased position risk push your account toward the maintenance-margin threshold.
2

Breach

Once maintenance margin is breached, the exchange steps in — you no longer control the timing.
3

Liquidation

The exchange closes the at-risk position to bring the account back within margin requirements.
Liquidation is automatic and not guaranteed to occur at any particular price. Manage your own margin headroom proactively: watch your positions and balances, use reduceOnly orders to de-risk, and keep buffer above maintenance margin rather than trading at the edge.
You can track your risk in real time:
curl -b cookies.txt "https://<api-host>/perps/positions"
Perp position records include size, entry price, mark, unrealized PnL, leverage, and a liquidation price so you can see how much room you have.

The insurance fund

When a liquidation cannot fully cover a position’s losses, the shortfall (bad debt) is absorbed by the exchange’s insurance fund rather than passed to other traders. The insurance fund is a shared backstop that grows over time and cushions the system against gaps in extreme moves. The insurance-fund balance is public:
curl "https://<api-host>/perps/insurance-fund"
A healthy insurance fund is a sign of system resilience. In severe conditions where the fund is insufficient, exchanges use additional deleveraging mechanisms as a last resort — so the best protection remains keeping your own positions well-collateralized.

Practical guidance

  • Preview every order to see margin required and approval status before sending.
  • Keep headroom above maintenance margin; don’t trade at the edge of your collateral.
  • Use reduceOnly for exit orders and protective stop / take-profit triggers for automated risk exits.
  • Wire cancel-all into your kill path so you can pull all resting orders instantly on a feed loss or risk breach.