Margining
Overview
The margining system at Bulk Exchange is designed to be robust and capital-efficient, providing traders with the tools to manage risk effectively. The system is built around the core concepts of Initial Margin and Maintenance Margin, with support for both isolated and cross-margin modes.
Margin Modes
When opening a position, you can select one of two margin modes. This choice determines how collateral is allocated and how risk is managed across your portfolio.
Cross Margin: This is the default mode and offers the highest capital efficiency. In Cross Margin mode, all of your available USDC collateral in your main account is shared across all of your cross-margin positions. The total profit and loss from all cross positions are aggregated, and the shared collateral pool is used to cover the margin requirements of all of them. This means a profitable position can help support a losing one, preventing liquidation.
Isolated Margin: This mode allows you to restrict the risk of a position to a specific amount of collateral. When you open an isolated position, you allocate a dedicated amount of collateral (
isolated_collateral
) to it. Only this collateral is used to support the position. A liquidation in an isolated position will not affect your other positions (either cross or other isolated positions), and likewise, events in other positions will not affect it. This is useful for managing risk on speculative or high-leverage trades without endangering your entire account.
Initial Margin (IM) and Leverage
Initial Margin is the collateral required to open a position or increase its size.
Calculation: The formula for Initial Margin is:
Initial Margin = (Position Size * Price) / Leverage
Leverage: Leverage is configured on a per-position basis. Before any order is accepted, the system performs a pre-flight margin check (
check_order_margin
) to ensure your account has sufficient available equity to meet the new Initial Margin requirement.Adjusting Leverage: A critical safety feature prevents users from changing the leverage of a position that has a non-zero size. To adjust leverage, you must first close the existing position.
Unrealized PnL: Unrealized PnL from your open positions directly impacts your available equity.
For Cross Margin, the sum of unrealized PnL from all cross positions is added to your total account collateral, affecting your ability to open new positions.
For Isolated Margin, the unrealized PnL is added to that specific position's isolated collateral, affecting only its own margin health.
Maintenance Margin (MM) and Liquidation
Maintenance Margin is the minimum amount of collateral required to keep a position open. If your account's equity falls below this level, the liquidation process will be triggered.
Liquidation Condition:
Equity < Total Maintenance Margin
Equity Calculation: The way your equity is calculated depends on the margin mode.
Isolated Equity =
position.isolated_collateral + position.unrealized_pnl
Cross Equity =
account.collateral + sum(unrealized_pnl of all cross-margin positions)
The unrealized_pnl
for any position is calculated against the current Mark Price. The specific Maintenance Margin rates are determined by a tiered system based on the notional value of your position. Please refer to the Margin Tierspage for detailed rates.
Last updated