Margining

Margin computations follow similar formulas to major centralized derivatives exchanges.

Margin Mode

When opening a position, a margin mode is selected. Cross margin is the default, which allows for maximal capital efficiency by sharing collateral between all other cross margin positions. Isolated margin is also supported, which allows an asset's collateral to be constrained to that asset. Liquidations in that asset do not affect other isolated positions or cross positions. Similarly, cross liquidations or other isolated liquidations do not affect the original isolated position.

Initial Margin and Leverage

Leverage can be set by a user to any integer between 1 and the max leverage. Max leverage depends on the asset.

The margin required to open a position is position_size * mark_price / leverage. The initial margin is used by the position and cannot be withdrawn for cross margin positions. Isolated positions support adding and removing margin after opening the position. Unrealized pnl for cross margin positions will automatically be available as initial margin for new positions, while isolated positions will apply unrealized pnl as additional margin for the open position. The leverage of an existing position can be increased without closing the position. Leverage is only checked upon opening a position. Afterwards, the user is responsible for monitoring the leverage usage to avoid liquidation. Possible actions to take on positions with negative unrealized pnl include partially or fully closing the position, adding margin (if isolated), and depositing USDC (if cross).

Maintenance Margin and Liquidations

Cross positions are liquidated when the account value (including unrealized pnl) is less than the maintenance margin times the total open notional position. The maintenance margin is currently set to half of the initial margin at max leverage.

Isolated positions are liquidated by the same maintenance margin logic, but the only inputs to the computation are the isolated margin and the notional value of the isolated position.

Last updated