# Cross Margin

One USDC cash balance backs every position and open order across venues.
Margin is summed per venue leg: a long on one venue and a short on another
each require margin, with no netting between them.

There is no per-position leverage setting. `leverage` is an output,
`grossNotional / accountValue`.

| Field | Meaning |
| --- | --- |
| `accountValue` | Cash plus unrealized PnL. |
| `initialMarginUsed` | Positions plus every open non-reduce-only order, any time-in-force, at the OI-scaled initial rate. |
| `maintenanceMarginUsed` | Positions only, at the maintenance rate. |
| `availableFunds` | `accountValue - initialMarginUsed`; new risk is admitted against this. |
| `excessLiquidity` | `accountValue - maintenanceMarginUsed`; liquidation starts below zero. |

The initial-margin rate for an asset rises with Mosaiq-wide gross open
interest, published as `universe[*].openInterestUsdc`. The formula is on the
[`clearinghouseState`](/api/clearinghouse-state#open-interest-and-initial-margin)
page.

## Orders and fills

An accepted order is not a position. Positions and cash change only when
confirmed fills settle into the ledger.

An open order reserves initial margin on its remaining size for as long as it
is `accepted`, `open`, `partially_filled`, or `uncertain`, regardless of `Ioc`
or `Alo`. The reservation is released as fills settle and when the order
reaches `filled`, `cancelled`, `failed`, or `not_on_book`. Reduce-only orders
reserve no margin. Resting reduce-only orders count toward `userCaps`
open-order limits; `Ioc` and market reduce-only orders do not.

Read `orderUpdates` for order state, `userFills` for fills, and
`marginSummary` from `clearinghouseState` for account impact.

See [Liquidation](/concepts/liquidation) and
[Rebalancing](/concepts/rebalancing).
