> For the complete documentation index, see [llms.txt](https://ocx.gitbook.io/ocx-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ocx.gitbook.io/ocx-doc/ocx/product/margin-and-risk.md).

# margin and risk

OCX uses a SPAN-style portfolio margin system. Instead of charging a fixed percentage per position, the engine simulates a range of market shocks across your whole portfolio and charges you for the worst outcome.

## SPAN-style scenario risk

For each underlying, OCX evaluates 16 scenarios that jointly shock price and volatility. The initial margin requirement is the loss in the worst scenario, plus credits for offsetting positions.

This produces requirements that are much lower than naive per-position margin when:

* You hold an option hedged by the underlying future.
* You hold opposing positions across the same family (e.g., a long future and a short perp on the same underlying).
* You hold correlated positions across different underlyings in the same asset class.

## Correlation credits

Positions across underlyings in the same asset class receive a credit:

| Asset class | Members       | Credit |
| ----------- | ------------- | ------ |
| Crypto      | BTC, ETH, MBT | 50%    |
| Equity      | ES, NQ        | 60%    |
| Energy      | CL, NG        | 40%    |

Credits apply only within a class — a long BTC and a long WTI are margined independently.

## Proper option greeks

Option exposures are evaluated with full Black-76 greeks (delta, gamma, vega, theta) under each scenario, not the moneyness-based approximations common in smaller exchanges. Deep in- and out-of-the-money options receive accurate margin treatment.

## Pre-computed risk arrays

Every five seconds, OCX precomputes a lookup table of scenario losses per instrument. Order-path margin checks consult this table and typically complete in under a millisecond.

If the lookup table is missing or stale for an instrument you try to trade, OCX **rejects** the order. The engine never silently approves an order it cannot price under stress.

## Initial vs maintenance margin

* **Initial margin (IM)** — the requirement to open or add to a position.
* **Maintenance margin (MM)** — the minimum equity that must remain to keep the position open.

OCX uses `IM ≈ 1.5 × MM` by default, with per-market overrides. You can preview the IM and MM impact of any order before sending it using the `/orders/preview` endpoint.

## Liquidation

If your account equity falls below the maintenance requirement, OCX begins a graduated liquidation:

1. The margin engine publishes a liquidation intent.
2. The execution system places reduce-only orders against the live book.
3. Any residual loss is absorbed by an insurance fund.
4. If the insurance fund is exhausted, an auto-deleveraging (ADL) mechanism partially closes positions of opposing counterparties, proportional to their PnL on the same market.

ADL is capped at closing 50% of a counterparty's position per event, across at most three counterparties, with a minimum closure of 0.0001 units. This limits ADL's impact on well-capitalised market makers.

## What you can do to reduce margin

* Combine long and short positions on the same underlying.
* Hedge option deltas with the matching future.
* Spread positions across correlated underlyings (captures the group correlation credit).
* Use `/orders/preview` to experiment with margin impact before committing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ocx.gitbook.io/ocx-doc/ocx/product/margin-and-risk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
