UserAccount holds one
position and the collateral that backs it. Free collateral is shared between
the open position and any resting orders.
Margin types
| Type | When checked | Default |
|---|---|---|
| Initial margin | Opening or increasing a position, and on withdrawal | 1000 bps (10%) |
| Maintenance margin | Every time a margin sensor runs (liquidation check) | 500 bps (5%) |
| Reserved margin | At place_order placement (resting orders) | Locks notional × initial_margin_ratio |
Formulas
Liquidation triggers when .Why reserved margin?
Without reservation, an attacker could:- Deposit 100 USDC.
- Place 10 resting limit orders, each of which individually passes the initial-margin check.
- Wait for adverse fills, and end up with a position whose required margin exceeds their deposit.
Max leverage
With V1’s 1000 bps ratio, that’s 10×.Liquidation price
Given an open position, the liquidation price is wherehealth hits 0:
Long:
Short:
The app displays this live and recalculates whenever your collateral or
position size changes.
Worked example
Settling funding changes collateral
Funding payments move silently in and out ofUserAccount.collateral when
settle_funding runs or when you trade. That means:
- Your liquidation price drifts over time even if mark hasn’t moved.
- Watch both mark and your collateral balance.
- Holding a losing direction through many funding periods can trigger liquidation purely from funding, not from adverse price.

