Margin Parameters
| Parameter | Config Key | Default | Unit | Onchain |
|---|---|---|---|---|
| Initial Margin Factor | imFactorBps | 200 bps (2%) | Basis points | Stored in Config |
| Maintenance Margin Factor | mmFactorBps | 100 bps (1%) | Basis points | Stored in Config |
| BPS Denominator | BPS_DENOMINATOR | 10,000 | Constant | Hardcoded |
Formulas
Invariant
mmFactorBps >= imFactorBps reverts.
Leverage Tiers
| Margin % | Margin (bps) | Leverage | Buffer to Liquidation | Example: 10,000 USDC Notional |
|---|---|---|---|---|
| 2% | 200 | 50x | ~1% adverse move | 200 USDC margin, 100 USDC MM |
| 5% | 500 | 20x | ~4% adverse move | 500 USDC margin, 100 USDC MM |
| 10% | 1,000 | 10x | ~9% adverse move | 1,000 USDC margin, 100 USDC MM |
| 20% | 2,000 | 5x | ~19% adverse move | 2,000 USDC margin, 100 USDC MM |
| 50% | 5,000 | 2x | ~49% adverse move | 5,000 USDC margin, 100 USDC MM |
| 100% | 10,000 | 1x | Cannot be liquidated | 10,000 USDC margin, 100 USDC MM |
Margin Operation Constraints
| Operation | Condition | Description |
|---|---|---|
| Open position | margin >= minIM | Must meet minimum initial margin |
| Open position | margin <= notional | Cannot exceed notional |
| Add margin | lockedMargin + amount <= notional | Total cannot exceed notional |
| Add margin | Always allowed | Works even when liquidatable (rescue) |
| Remove margin | remaining >= minIM | Must maintain minimum IM |
| Remove margin | equity after > mmThreshold | Must not become liquidatable |
| Remove margin | Position not liquidatable | Cannot remove from underwater position |
Liquidation Condition
<). A position with equity exactly equal to MM is not liquidatable.
Snapshotted Fields
These values are captured at position open time and never change for that position:| Field | Source | Description |
|---|---|---|
snapshotImBps | Config | IM factor when position was opened |
snapshotMmBps | Config | MM factor when position was opened |
snapshotTradingFeeBps | Config | Trading fee when position was opened |
snapshotLiquidationPenaltyBps | Config | Liquidation penalty when position was opened |
snapshotOracleFee | Config | Oracle fee when position was opened |
Related Pages
Margin Model
Conceptual explanation of isolated margin, leverage, and equity.
Liquidation
Liquidation mechanics, penalty calculation, and keeper incentives.
Parameter Reference
Complete list of all configurable protocol parameters.