Protocol
Perpetual mechanics
Margin, leverage, mark price and liquidation logic.
Margin and leverage
Position size equals collateral multiplied by leverage, up to 50x. Maintenance margin is 0.8% of notional; positions falling below it are eligible for liquidation.
positionSize = collateral * leverage
liqPrice(long) = entry * (1 - 0.92 / leverage)
liqPrice(short) = entry * (1 + 0.92 / leverage)Mark price
Mark price is a time-weighted composite of the index price and the protocol's own order flow. Using mark price rather than last trade protects positions from wick-driven liquidations.
Liquidations
Liquidations are partial where possible: the engine reduces the position until margin is restored. Remaining collateral is returned to the trader, and a share of the liquidation fee flows to the vault.
