# Cross margin

One USDC cash balance of the account backs every position and open order, on
every venue. Mosaiq sums margin per venue leg: a long on one venue and a short
on another each need margin, with no netting between them.

There is no leverage setting. `leverage` is an output.

Mosaiq checks a new order against `availableFunds`, and liquidates the account
when `excessLiquidity` falls below zero while it has maintenance margin.
[Positions and margin](/api/clearinghouse-state#positions-and-margin) defines
each field of `marginSummary`.

The initial-margin rate of an asset rises once Mosaiq's total open interest on
the asset, `marketData.openInterestUsdc[name]`, passes a threshold set per
asset. [Open interest and initial margin](/api/clearinghouse-state#open-interest-and-initial-margin)
lists the thresholds.

## Orders and fills

An accepted order is not a position. A trade changes positions and cash when
its confirmed fills settle.

An open order reserves initial margin on its remaining size while it is
`accepted`, `open`, `partially_filled`, or `uncertain`, for `Ioc` and `Alo`
alike. Mosaiq releases the reservation as fills settle, and when the order
reaches `filled`, `cancelled`, `failed`, or `not_on_book`. A reduce-only order
reserves no margin. A resting reduce-only order counts toward the open-order
limits of `userCaps`. An `Ioc` or market reduce-only order does not.

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

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