Skip to main content
Pure parameter reference for margin thresholds. For conceptual explanation of the margin model, see Margin Model.

Margin Parameters

ParameterConfig KeyDefaultUnitOnchain
Initial Margin FactorimFactorBps200 bps (2%)Basis pointsStored in Config
Maintenance Margin FactormmFactorBps100 bps (1%)Basis pointsStored in Config
BPS DenominatorBPS_DENOMINATOR10,000ConstantHardcoded

Formulas

minIM = notional × imFactorBps / BPS_DENOMINATOR
mmThreshold = notional × mmFactorBps / BPS_DENOMINATOR
equity = lockedMargin + unrealizedPnL
liquidatable = equity < mmThreshold

Invariant

imFactorBps > mmFactorBps    (enforced by Config.setMarginConfig())
Any attempt to set mmFactorBps >= imFactorBps reverts.

Leverage Tiers

Margin %Margin (bps)LeverageBuffer to LiquidationExample: 10,000 USDC Notional
2%20050x~1% adverse move200 USDC margin, 100 USDC MM
5%50020x~4% adverse move500 USDC margin, 100 USDC MM
10%1,00010x~9% adverse move1,000 USDC margin, 100 USDC MM
20%2,0005x~19% adverse move2,000 USDC margin, 100 USDC MM
50%5,0002x~49% adverse move5,000 USDC margin, 100 USDC MM
100%10,0001xCannot be liquidated10,000 USDC margin, 100 USDC MM

Margin Operation Constraints

OperationConditionDescription
Open positionmargin >= minIMMust meet minimum initial margin
Open positionmargin <= notionalCannot exceed notional
Add marginlockedMargin + amount <= notionalTotal cannot exceed notional
Add marginAlways allowedWorks even when liquidatable (rescue)
Remove marginremaining >= minIMMust maintain minimum IM
Remove marginequity after > mmThresholdMust not become liquidatable
Remove marginPosition not liquidatableCannot remove from underwater position

Liquidation Condition

positionEquity < mmThreshold
Strict less-than (<). 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:
FieldSourceDescription
snapshotImBpsConfigIM factor when position was opened
snapshotMmBpsConfigMM factor when position was opened
snapshotTradingFeeBpsConfigTrading fee when position was opened
snapshotLiquidationPenaltyBpsConfigLiquidation penalty when position was opened
snapshotOracleFeeConfigOracle fee when position was opened
Admin changes to these parameters only affect positions opened after the change.

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.