# Costs of Opening Positions

### **Cost of Opening a Limit Order**

<figure><img src="/files/DGpgETUZPkJ568s2Kyc3" alt=""><figcaption></figcaption></figure>

1. #### **Calculate the initial margin**

Initial margin

\= Notional Value / Leverage Multiplier

\= (102,990.0\*1 BTC)/20x

\= 5,149.50<br>

2. #### **Calculate open loss**

Open Loss = Number of Contracts × Absolute Value {min \[0, Order Direction × (Mark Price — Order Price)]}

Direction of order: 1 for long order; -1 for short order

**Open loss of long orders:**

\= Number of Contract \* Absolute Value {min\[0, Direction of order \* (Mark price — Order Price)]}

\= 1 \* Absolute Value {min\[0, 1 \* (102,988.4- 102,990.0)]}

\= 1 \* Absolute Value {min\[0, (-1.6)]}

\= 1 \* 1.6

\= 1.6

Open loss occurs when you place a long order.

**Open loss of short orders:**

\= Number of Contract \* Absolute Value {min\[0, Direction of order \* (Mark Price — Order Price)]}

\= 1 \* Absolute Value {min\[0, -1 \* (102,988.4- 102,990.0)]}

\= 1 \* Absolute Value {min\[0, 1.6]}

\= 1 \* 0

\= 0

Open loss does not occur when you place a short order.<br>

3. #### **Calculate the cost of opening a position**

Since there is no open loss when you place a short order, the cost of opening a short order is equal to the initial margin.

**Cost of opening a long order:**

\= 5,149.50+ 1.6

\= 5,151.1

**Cost of opening a short order:**

\= 5,149.50 + 0&#x20;

\= 5,149.50

Since placing a long order results in an open loss, it requires more margin than a short order. In addition to the initial margin, you must also take into account the open loss.

### **Cost of Opening a Market Order**

1. #### **Calculate estimated entry price**

Long order estimated entry price = ask\[0] \* (1 + 0.05%); Short order estimated entry price = max(bid\[0], mark price)<br>

**Estimated entry price of long orders:**

\= ask\[0]\*(1 + 0.05%)

\= 102,946.8\*(1 + 0.05%)

\= 102,998.27

\*\[0]：Level 1 price<br>

**Assuming price of short orders:**

\= max(bid\[0], mark price)

\= max (102,946.9, 102,941.0)

\= 102,946.9

\*\[0]：Level 1 price<br>

2. #### **Calculate the initial margin**

Initial Margin = Notional Value / Leverage Multiplier<br>

* Initial margin for long orders

\= Estimated entry price of long order \* Number of Contracts / Leverage Multiplier

\= 102,998.27 \* 1 /20

\= 5,149.9135<br>

* Initial margin for short orders

\= Estimated entry price of short order \* Number of Contracts / Leverage Multiplier

\= 102,946.9 \* 1/20

\= 5,147.345<br>

3. #### **Calculate the open loss**

Open Loss = Number of Contract \* Absolute Value {min\[0, direction of order \* (mark price — order price)]}

Direction of order: 1 for long order; -1 for short order<br>

**Open loss for long order:**

\= Number of Contract \* Absolute Value {min\[0, direction of order \* (mark price — order price)]}

\= 1 \* Absolute Value {min\[0, 1 \* (102,941.0–102,998.27)]}

\= 1 \* Absolute Value {min\[0, -57.27]}

\= 1 \* 57.27

\= 57.27

An open loss occurs when you place a long order.<br>

**Open loss for short order:**

\= Number of Contract \* Absolute Value {min\[0, direction of order \* (mark price — order price)]}

\= 1 \* Absolute Value {min\[0, -1 \* (102,941.0–102,946.9)]}

\= 1 \* Absolute Value {min\[0, 5.9]}

\= 1 \* 0

\= 0

An open loss does not occur when you place a short order.<br>

4. #### **Cost of Opening a Position**

Since open loss occurs when you place a long order, it costs more to place a long order. In addition to the initial margin, you must also take into account the open loss.

**Cost of opening a long order:**

\= 5,149.9135+57.27

\= 5,207.1835<br>

**Cost of opening a short order:**

\= 5,147.345+0

\= 5,147.345

Since there is no open loss when you place a short order, the cost of opening a short order is equal to the initial margin.


---

# 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://docs.asterdex.com/trading/perpetuals/fees-and-specs/costs-of-opening-positions.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.
