# Margin - IM, MM, and UM

## Margin Trading

Margin trading is a method of trading assets using funds provided by others. When compared to regular trading accounts, margin accounts allow traders to access greater sums of capital, allowing them to leverage their positions. Essentially, margin trading amplifies trading results so that traders can realize larger profits on successful trades.

Example:

```
A trader initiates a margin trade, he/she has 2 BTC and is using 10x leverage.
Initial Margin = 2 BTC
Contract Value = Initial Margin x Leverage = 20 BTC
Initial Margin Rate = 1 / Leverage = 10%
```

## Initial Margin

Initial Margin is the amount of collateral required to open a position for leverage trading.

To calculate an initial margin, multiply the order value with the initial margin rate. The initial margin rate depends on the leverage used. Assuming you use a 100x leverage in contract value of 100 dollars, you would only need to invest 1 dollar as your initial margin (1/100).

To check the initial margin rate for your position, and the maximum leverage you can use, you may refer to the risk limit table.

Example:

```
A trader buys 6,000 BTCUSD contracts at 10,000 USD with 25x leverage.
Initial Margin = Quantity of Contracts / (Order Price × Leverage)
= 6,000/(10,000×25)
= 0.024 BTC
```

## Maintenance Margin

Maintenance Margin is the minimum account value required to continue holding a position.

Liquidation occurs when the isolated margin for the position is less than its maintenance margin level.

Example:

```
A trader buys 6,000 BTCUSD contracts at 10,000 USD with 25x leverage.
The maintenance margin used for this position is:
Maintenance Margin = (Quantity of Contracts / Order Price) × Maintenance Margin Rate
= (6,000/10,000)×0.5%
= 0.003 BTC
Initial Margin = 6,000/(10,000*25)
= 0.024 BTC
```

This means that this position may have an unrealized loss of up to 0.021 BTC (0.024 BTC - 0.003 BTC) before the occurrence of liquidation.

## Used Margin

Used margin = Positions margin + Order Margin

Positions Margin= Used margin of positions + Fee to close

Order Margin = Used margin of open order + 2-way taker fee (Fee to open + Fee to close)