How to Calculate the Opening Cost of a Perpetual Contract
How to Calculate the Opening Cost of a Perpetual Contract
The opening cost consists of two components: Initial Margin + Opening Trading Fee. The following uses the Gold (XAUUSD) Perpetual Contract as an example to demonstrate the calculation step by step.
1. Terminology
Term | Description |
Notional Value | Order Price × Order Quantity × Contract Value |
Initial Margin | The minimum margin required to open a position. |
Maintenance Margin | The minimum margin required to maintain a position. Falling below this level triggers liquidation. |
Fee Rate | Maker or Taker fee rate. |
Notional Value | The total value controlled by the held position. For example, if Gold is priced at 3,300 USD and you buy 1 lot, the Notional Value is 3,300 USD. |
Lot | The quantity unit used when placing an order. Entering 1 means 1 lot. For example, 1 lot of Gold equals 1 troy ounce. If 1 ounce is priced at 3,300 USD, buying 1 lot gives a Notional Value of 3,300 USD. |
2. Long Position (Go Long) — Margin Pre-freeze
Long Pre-freeze = Notional Value × (1/Leverage + 2 × Taker Fee Rate)
This includes: Notional Value / Leverage (Initial Margin) + Opening Fee + Reserved Closing Fee.
📚Example
Gold price 3,300 USD, open long 1 lot, 10x leverage, Taker fee rate 0.05%:
Notional Value = 3,300 × 1 × 1 = 3,300 USD
Long Pre-freeze = 3,300 × (1/10 + 2 × 0.05%) = 3,300 × 0.1010 = 333.30 USD
3. Short Position (Go Short) — Margin Pre-freeze
Short Pre-freeze = Notional Value × [(1/Leverage + Taker Fee Rate) × (1 + Taker Fee Rate) + Taker Fee Rate × (1 − Maintenance Margin Ratio)]
📚Example
Gold price 3,300 USD, open short 1 lot, 10x leverage, Taker fee rate 0.05%, Maintenance Margin Ratio 0.5%:
Short Pre-freeze = 3,300 × [(0.1 + 0.0005) × (1.0005) + 0.0005 × (1 − 0.005)]
= 3,300 × [0.1005 × 1.0005 + 0.0005 × 0.995]
≈ 3,300 × [0.10055 + 0.000498] ≈ 3,300 × 0.10105 ≈ 333.46 USD
4. Opening Trading Fee
Opening Fee = Average Fill Price × Fill Quantity × Contract Value × Fee Rate
📚Example
Opening Fee = 3,300 × 1 × 1 × 0.05% = 1.65 USD
5. Actual Position Margin (After Opening)
Note: The pre-freeze amount includes the opening fee and a reserved closing fee. After the trade is filled, the opening fee has already been deducted from the account. Therefore, the position margin no longer includes the deducted opening fee — it only retains the initial margin and the reserved closing fee.
Long Position
Long Position Margin = Average Entry Price × Position Size × Contract Value × (1/Leverage + Fee Rate)
Short Position
Short Position Margin = Average Entry Price × Position Size × Contract Value × [(1/Leverage) × (1 + Fee Rate) + Fee Rate × (1 − Maintenance Margin Ratio)]
The above calculations are based on illustrative parameters. Actual results are subject to platform display. You can view the estimated margin and fee on the order interface before opening a position.
*Note: The above calculations use example parameters. Actual pre-freeze amounts, position margins, and fees are subject to the platform page and final trade execution results.