How to calculate the maximum addable/removable margin in Cross and Isolated Margin Modes?
Cross Margin Mode
- crossWalletBalance - ∑Isolated Open Order Initial Margin - Cross Position Maintenance Margin
- crossWalletBalance + ∑Cross Unrealized PNL - ∑Cross Initial Margin - ∑Isolated Open Order Initial Margin
Isolated Margin Mode
USDⓈ-Margined contracts
Field | Calculation |
Max addable amount to Isolated Margin | max (0, min(crossWalletBalance - ∑isolated open order initial margin - ∑crossPosition MM, Isolated Available for Order)) |
Max removable amount from Isolated Margin | max (0, min (isolatedWalletBalance - isolatedPosition MM, isolatedWalletBalance + size * (Mark Price - Entry Price) - Mark Price * abs(size) * IMR )) |
COIN-Margined contracts
Field | Calculation |
Max addable amount to Isolated Margin | max (0, min (crossWalletBalance - ∑Isolated Open Order Initial Margin - ∑crossPosition MM, Isolated Available for Order)) |
Max removable amount from Isolated Margin | max (0, min (isolatedWalletBalance - isolatedPosition MM, isolatedWalletBalance + size * contractSize * (1 / Entry Price - 1 / Mark Price) - abs(size) * contractSize * IMR / Mark Price)) |