UserAccount holds one
position and the collateral that backs it. Free collateral is shared between
the open position and any resting orders.
Margin types
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.

