Margining

Initial Margin Requirement (IMR)

IMR is a product parameter and is expressed as a percentage under 100% (eg 0.30). For a product Ψ. Initial Margin (IM) relates to a trade j and is a monetary amount in the product Ψ’s Price Quotation units. It is defined conditionally on the type of position change:

  • if the position increases: IM[Ψ][j] = IMR * POINT_VALUE * p[j] * abs(q[j])
  • if the position reverses: IM[Ψ][j] = IMR * POINT_VALUE * p[j] * abs(q[j] + Q[j-1])

Maintenance Margin Requirement (MMR)

MMR is a product parameter and is expressed as a percentage under 100% (eg 0.20). Maintenance Margin relates to a position and is a monetary amount in the product’s Price Quotation units and is defined as: MM[Ψ][j] = MMR * abs(B[j])

Maintenance Margin Used (MMU) is defined for the n products in which the margin account holder has a non-zero position: MMU[k] = sum(MM[1][k],.., MM[n][k]) where k is an index over all trades and n products in a Margin Account.

Maintenance Margin Available (MMA) is then defined as: MMA[k] = max(MAE - MMU[k], 0). This is the amount of collateral that can be used to fund new trades.

Initial Margin Check

If a trade increases an account’s position size, it must be the case that IM <= MMA in order for the trade to settle. If IM > MMA, the trade will fail. For trades that decrease position size, the check for IM is ignored.

If a trade reverses an account’s position, then the checks are split into the two following operations:

  1. First, the account’s position is decreased to zero, where the IM check is ignored. And the MAE, MMU, MMA (whichever is stored on chain) for the account is updated.
  2. Second, the account’s position is increased, at which point the IM check is applied.

In the case of multiple position changes as part of a single trade, the IM check is performed as follows:

  1. All reversing trades are broken down into a decreasing trade and an increasing trade

  2. The account’s MMU is decreased by the amount freed up by the decreasing trade:

    MMU' = MMU - sum(MMR[j] * (abs(B[j]) - abs(B'[j])))

    Where:

       - `B'[j]` is the cost basis after the trade for product `Ψ[j]`. 
       - `B[j]` is the cost basis before the trade for product `Ψ[j]`. 
       - `MMR[j]` is the MMR for the product `Ψ[j]`.

    Note that here MMU' is not strictly equal to the MMU after the trade, as it does not take into account the new Maintenance Margin for the increasing trades. It is only an intermediate value used to perform the IM check.

  3. The IM check is performed on the increasing trades:

    sum(IM[Ψ][j]) <= MAE' - MMU'

    Where MAE' is the MAE after the trade. If this check fails, the trade is reverted.

    If MU >= 100% (equivalently, MMA = 0), the account enters LIQUIDATABLE state and any non-zero product position in the account may get liquidated in whole or part by the clearing system’s liquidation auction mechanism.