Informational Notes
Ez a cikk jelenleg nem érhető el a nyelveden. Javasoljuk az automatikus fordítást angol nyelvre.

How to Calculate the Cost Required to Open a Position in Perpetual Futures Contracts?

2020-07-08 06:39

Last updated: 6 November 2024

In compliance with MiCA requirements, unauthorized stablecoins are subject to certain restrictions for EEA users. For more information, please click here.

Before opening a position, traders must ensure that they have a sufficient amount of funds in their wallet balance. The cost required to open a position includes the initial margin and open losses (if applicable). Open losses occur when the price of a futures contract goes unfavorably (e.g., the mark price is lower than the order price for a long order). Binance includes open losses as part of the cost required to open a position to prevent forced liquidation when traders place an order. If open losses are not accounted for, there is a high risk that the position will be liquidated immediately after the order is placed.

The formula to calculate the cost required to open a position is:

Cost = Initial Margin + Open Loss (if any)

1. Cost required to open a limit or stop order

Step 1: Calculate the initial margin

Initial Margin = Notional Value / Leverage

= (9,253.30 * 1 BTC) / 20

= 462.66

Step 2: 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

(i) Open Loss of a Long Order

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

= 1 * Absolute Value {min[0, 1 * (9,259.84 - 9,253.30)]}

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

= 1 * 0

= 0

There is no open loss when the user opens a long order.

(ii) Open loss of a short order

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

= 1 * Absolute Value {min[0, -1 * (9,259.84 - 9,253.30)]}

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

= 1 * 6.54

= 6.54

There is an open loss when the user opens a short order.

Step 3: Calculate the cost required to open a position

Since the long order has no open loss, the cost required to open a long position is equivalent to the initial margin.

(i) Cost required to open a long position

= 462.66 + 0

= 462.66

Since the short order has an open loss, the cost required to open a short position is higher, as the open loss must be taken into consideration in addition to the initial margin.

(ii) Cost required to open a short position

= 462.66 + 6.54

= 469.20 (rounding difference)

2. Cost required to open a market order

Step 1: Calculate the assuming price

Long Order: Assuming Price = Last Price * (1 + 0.1%)

Short Order: Assuming Price = Last Price * (1 + 0.1%)

(i) Assuming price of a long order

= Last Price * (1 + 0.1%)

= 10,461.78 * (1 + 0.1%)

= 10,472.24

(ii) Assuming price of a short order

= Last Price * (1 + 0.10%)

= 10,472.24

Step 2: Calculate the initial margin

Initial Margin = Notional Value / Leverage

(i) Initial margin of a long order

= Assuming Price * Number of Contract / Leverage

= 10,472.24 * 0.2 / 20

= 104.7224

(ii) Initial margin of a short order

= Assuming Price * Number of Contract / Leverage

= 10,472.24 * 0.2 / 20

= 104.7224

Step 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

(i) Open loss of a long order

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

= 0.2 * Absolute Value {min[0, 1 * (10,461.83 - 10,472.24)]}

= 0.2 * Absolute Value {min[0, -10.41]}

= 0.2 * 10.41

= 2.082

There is an open loss when the user opens a long order.

(ii) Open loss of a short order

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

= 0.2 * Absolute Value {min[0, -1 * (10,461.83 - 10,472.24)]}

= 0.2 * Absolute Value {min[0, 10.41]}

= 0.2 * 0

= 0

There is a small open loss when the user opens a short order.

Step 4: Calculate the cost required to open a position

For a long order, since there is an open loss, the cost required to open a long position is higher because the open loss must be taken into consideration in addition to the initial margin.

(i) Cost required to open a long position

= 104.6701089 + 2.082

= 106.75 (rounding difference)

Since the short order has an open loss, the cost required to open a short position is slightly higher

(ii) Cost required to open a short position

= 104.6178 + 0

= 104.6178 (due to the update of assuming price calculation logic)

For more information regarding USDⓈ-M Futures Contracts, please refer to: