# Initial Margin

## Initial margin

The initial margin is the cost of opening a position, which is related to the position's value and the leverage used. The initial margin will be frozen when the order is placed and will be transferred to the position after the transaction, becoming the initial margin.

> Initial margin = open order value / leverage = order price \* order quantity / leverage
>
> Calculation reference for position opening value of coin-margined futures: [calculation of USDⓈ-margined | coin-margined position opening value](https://futuresdoc.gitbook.io/perp-doc/english-1/size-or-quantity-or-value#contract-size-or-order-quantity)

### Initial margin calculation for holding positions

When calculating the occupied margin, we will use it to calculate the initial margin to protect the user's position.

For example: when calculating the availability, the margin occupied by the cross position should be subtracted; when calculating how much margin can be transferred out of the isolated position, the initial margin should also be retained.

> Initial margin = position value / leverage = position quantity \* mark price / leverage
>
> Calculation reference for coin-margined position value: [calculation of USDⓈ-margined | coin-margined position value](https://futuresdoc.gitbook.io/perp-doc/english-1/size-or-quantity-or-value#calculation-of-values)

## The opening value of the market order

Unlike other exchanges, our market order uses the method of directly entering the "opening value" instead of estimating the opening value based on the opening quantity. That means when opening a position at the market price of USDⓈ-margined futures, what you input is the amount of BTC in USDT, not the amount of BTC. How many BTC positions you can open depends on the actual transaction situation.

| Market                | Opening Value       | Closing Quantity            |
| --------------------- | ------------------- | --------------------------- |
| USDⓈ-Margined Futures | Input value: x USDT | Input quantity: x Cont./BTC |
| Coin-Margined Futures | Input value: x BTC  | Input quantity: x Cont./USD |

{% hint style="info" %}
Other types of orders are to enter the quantity!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://futuresdoc.gitbook.io/perp-doc/english-1/parameters/initial-margin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
