Every market on Perpetra has its own risk parameters, enforced on-chain by the Risk Engine every time you open or increase a position. This page covers what those checks actually are.
Leverage limits
Each market defines a minLeverage and maxLeverage. When you open or increase a position, both are enforced:
The floor exists so a position can’t be so over-collateralized that it falls below the market’s minimum leverage. The ceiling is the max leverage shown on the leverage slider.
Initial margin
Initial margin is a separate check from the leverage ceiling, not derived from it. Each market has its own initialMarginBps:
Your collateral must meet or exceed this amount to open or increase a position. In practice a market’s initialMarginBps is usually set to correspond to its maxLeverage (for example, an initialMarginBps of 100 pairs with a maxLeverage of 100x), but they’re enforced as two independent checks on-chain.
Open interest caps
Beyond a single position’s size, each market also caps total exposure on each side:
A single position is also capped by maxPositionSizeUsd, regardless of leverage or available open interest.
Margin ratio and maintenance margin
Once a position is open, its health is tracked continuously:
A position becomes eligible for liquidation when:
initialMarginBps is always required to be greater than
maintenanceMarginBps for a market. The gap between the two is your buffer:
how far effective collateral can fall from where you opened before the
position is liquidatable.
Margin mode changes what “Collateral” means
These formulas apply the same way regardless of margin mode, but the collateral figure feeding into them differs:
- In isolated mode, each position is checked independently against its own fixed collateral.
- In cross mode, positions sharing a collateral token are checked together at the account level, not one at a time. See Margin Modes for exactly how that account-level check works.
For the price level at which effective collateral actually crosses below maintenance margin, see PnL & Liquidation.