Position Margin under Isolated Margin mode

In isolated margin mode, it depicts the margin placed into a position is isolated from the trader's account balance. In the event of liquidation, the trader will only lose all of his position margin (excluding funding fees). Hence, the position margin under isolated margin mode is:

FORMULA

Position Margin (Isolated Margin mode) = Initial Margin + Fee to Close

Replenishment of position margin under Isolated Margin mode

When a trader pays funding fee for a position, the funding fee will be deducted from the available balance at every funding timing. In the event where a trader has insufficient available balance, the funding fee will then be deducted from position margin and this will result in the position's liquidation price to move closer to the mark price and increase the risk of liquidation.

To avoid this from happening, traders can make deposits, perform asset exchange increases or release order margin from cancelling active orders to replenish their position margin or increase the available balance. However, do note that, under different contracts and different scenarios, the process of replenishment to position margin will be different too.

Position Margin under Cross Margin mode

One way position:

FORMULA
  • Position Margin under Cross Margin with Unrealized Profit = Initial Margin + Fee to Close
  • Position Margin under Cross Margin with Unrealized Loss = Initial Margin + Fee to Close – Unrealized Loss

Example 1: Position with Unrealized Profit.

Trader place a Long (Buy) position of 70 BTC at USD 20,000 with 50x leverage under Cross Margin mode. The Current available balance is 31,000 USDT, Initial Margin = 28,000 USDT, Fee to Close = 542 USDT. Hence, the position margin right affter the position opened is 28000 + 542 = 28542 USDT

Now, the unrealized P&L (Mark Price) is in 225 of unrealized profit. The position margin will still remain as 28,542 USDT, while available balance remain as 31,000 USDT.

No changes to the position margin or available balance, as the unrealized profit cannot be used as available balance. It will only be realized after the position is closed.

Example 2: Position with Unrealized Loss

Trader place a Long (Buy) position of 70 BTC at USD 20,000 with 50x leverage under Cross Margin mode. The Current available balance is 31,000 USDT, Initial Margin = 28,000 USDT, Fee to Close = 542 USDT. Hence, the position margin right after the position opened is 28000 + 542 = 28542 USDT

Now, the unrealized P&L (Mark Price) is in -225 of unrealized loss. Now position margin will become 285424 – (-225) = 28767 USDT and the available balance = 31000 – 28767 = 2,233 USDT.

From the above scenario, we can see that 225 USDT has been deducted from available balance and added to position margin to cover the unrealized loss (mark price). 

Fully hedged position:

For a fully hedged position under cross margin mode, the quantity for long and short position must be the same. Fully hedged positions will not be liquidated as the unrealized profit of one position will be used to support the unrealized loss of the opposite direction of position under the same trading pair. 

FORMULA
  • Position Margin (Long Position) = 1.2 * Maintenance Margin Rate * Position Value + Fee to Close - Net unrealized loss
  • Position Margin (Short Position)= 1.2 * Maintenance Margin Rate * Position Value + Fee to Close

Suppose trader place a Long (Buy) position of 750 SOL at 2.762 USDT with 50x leverage cross margin mode. The current available balance is 121.3345 USDT, maintenance margin rate = 0.1%.

Initial margin = 41.4298 USDT, fee to close = 1.5225 USDT. Hence, the position margin right after the position is opened is 41.4298 + 1.5225 ≈ 42. 95 USDT. 

Now, the mark price decreases to 2.757 USDT, net unrealized loss (mark price) = 3.75 USDT

Position margin = 42.95 + 3.75 = 46.7 USDT

Available balance = 121.3345 - 3.75 = 117.5845 USDT

Now, the mark price dropped further to 2.756 USDT, and trader A decided to lock in the loss (mark price) of 4.5 USDT, and opened a short entry of 2.756 USDT, with the same quantity of 750 SOL. 

The position margin of long and short position will become:

Long position = (1.2 * 0.1% * 2071.5) + 1.5536 -(-4.5) ≈ 8.54 USDT

Short position = (1.2 * 0.1% * 2067) + 1.5813 ≈ 4.06 USDT

Regardless how the price movement is, the position margin will remain the same as the 4.5 USDT loss from the long position has been locked in. Any further unrealized loss or profit of either position will be used to support the other position. Available balance will not be affected and remain the same as 105.4710 USDT. 

Partially hedged position

FORMULA
  • Position Margin for position with lesser quantity = 1.2 * Maintenance Margin Rate * Position Value + Fee to Close
  • Position Margin for position with more quantity = 1.2 * Maintenance Margin Rate * Position Value for fully hedged proportion + fee to close + initial margin of unhedged proportion + net unrealized loss of fully hedged proportion + unrealized loss of unhedged position

Example 1:

Trader A has 1000 SOL of SOLUSDT long position at USD 2.817 and 1200 SOL of SOLUSDT short position at USD 2.814, cross margin mode with 50x leverage.

 

Long Position

Short Position

Quantity

1000 SOL

1200 SOL

Entry Price

2.817 

2.814

Position Value

1000 * 2.817 = 2817 USDT

1200 * 2.814 = 3376.8 USDT

Initial Margin

1000 * 2.817 / 50 = 56.34 USDT

1200 * 2.814 / 50 = 67.536 USDT

Fee to Close

2.0704 USDT

2.583 USDT

Unrealized P&L (Mark Price)

-8 USDT

6 USDT

 

Net unrealized P&L of fully hedged proportion (1000 SOL) = -8+ (6/1200*1000)= -3 USDT (loss).

Unrealized P&L of unhedged proportion (200 SOL)= 6 / 1200 * 200 = 1 USDT (Profit)

Position Margin for:

  • Long (Buy) Position (Less quantity) =  1.2 * 0.1% * 2817 + 2.0704 = 5.4508 USDT
  • Short (Sell) Position (More quantity) = 1.2 * 0.1% * (3376.8/1200*1000) + 2.5831 + (67.536/1200*200) - (-3) + 0 = 20.2159 USDT

Example 2:

Trader B has 1000 SOL of SOLUSDT long position at USD 2.817 and 500 SOL of SOLUSDT short position at USD 2.809, cross margin mode 50x leverage. 

 

Long Position

Short Position

Quantity

1000 SOL

500 SOL

Entry Price

2.817 

2.809

Position Value

1000 * 2.817 = 2817 USDT

500 * 2.809 = 1404.5 USDT

Initial Margin

1000 * 2.817 / 50 = 56.34 USDT

500 * 2.814 / 50 = 28.09 USDT

Fee to Close

2.0704 USDT

1.074 USDT

Unrealized P&L (Mark Price)

-10 USDT

1 USDT

 

Net unrealized P&L of fully hedged proportion (500 SOL) = (-10/1000*500) +1 = -4 USDT (loss)

Unrealized P&L of unhedged proportion (500 SOL) = -10 / 1000 * 500 = -5 USDT (loss)

Position Margin for:

  • Long position (More quantity) = 1.2 * 0.1% * (2817/1000*500) + 2.0704 + (56.34/1000*500) - (-4) - (-5) = 39.5221 USDT
  • Short position (Less quantity) = 1.2 * 0.1% * 1404.5 + 1.0744 = 2.7598 USDT

When the unrealized loss increases, the position margin of the more quantity position will increase and the available balance will be decreased.