Coinlocally Docs
Perpetual Contracts
Perpetual Contracts
  • Introduction
  • Overview
    • Funding Rate
    • Mark Price
    • Index Price
    • Ladder Balancing Mechanism
    • Insurance Fund
    • Auto-Deleveraging (ADL)
  • USDT Margined Perpetual Contract
    • Introduction
    • Leverage and Position Limit
    • Ladder Maintenance Margin Rate
    • Margin and Profit/Loss Calculations
  • Coin Margined Perpetual Contracts
    • Currency Standard Perpetual Contract
    • Leverage and Position Limit
    • Ladder Maintenance Margin Rate
    • Margin and Profit/Loss Calculations
  • Functions
    • Perpetual Contract User Guide
    • One-way and Two-way Positions
    • Conditional Order
    • Take Profit, Stop Loss TP/SL
    • Take Profit Stop Loss Order
    • Contract Grid
    • Futures Copy
      • How to Carry Out a Transaction
      • Profit Sharing
      • How to Copy Trade
      • Futures Copy Trading Rules
Powered by GitBook
On this page
  • 1. Opening Margin
  • 2. Average Opening Price
  • 3. Profit and Loss Calculation
  1. USDT Margined Perpetual Contract

Margin and Profit/Loss Calculations

1. Opening Margin

The opening margin consists of two components:

  • Initial Margin

  • Opening Loss

Including the opening loss (if any) at the time of order placement helps prevent immediate liquidation due to unfavorable price movement at the time of opening.

1.1 Initial Margin

Initial Margin=Notional ValueLeverage\text{Initial Margin} = \frac{\text{Notional Value}}{\text{Leverage}}Initial Margin=LeverageNotional Value​

For USDT-margined contracts:

Notional Value=Order Price×Quantity×Contract Size\text{Notional Value} = \text{Order Price} \times \text{Quantity} \times \text{Contract Size}Notional Value=Order Price×Quantity×Contract Size

1.2 Opening Loss

Opening Loss=Quantity×Contract Size×∣min⁡(0, Order Direction×(Mark Price−Order Price))∣\text{Opening Loss} = \text{Quantity} \times \text{Contract Size} \times \left| \min \left( 0,\ \text{Order Direction} \times (\text{Mark Price} - \text{Order Price}) \right) \right|Opening Loss=Quantity×Contract Size×∣min(0, Order Direction×(Mark Price−Order Price))∣

Where:

  • Order Direction = 1 for Long, -1 for Short

Example

  • Contract: BTC/USDT

  • Order Price: 60,000 USDT

  • Mark Price: 55,000 USDT

  • Order Quantity: 10,000 contracts

  • Contract Size: 0.0001 BTC

  • Leverage: 10×

Initial Margin=60,000×10,000×0.000110=6,000 USDT\text{Initial Margin} = \frac{60,000 \times 10,000 \times 0.0001}{10} = 6,000\ \text{USDT}Initial Margin=1060,000×10,000×0.0001​=6,000 USDT
Opening Loss=10,000×0.0001×5,000=5,000 USDT\text{Opening Loss} = 10,000 \times 0.0001 \times 5,000 = 5,000\ \text{USDT}Opening Loss=10,000×0.0001×5,000=5,000 USDT
Opening Margin=6,000+5,000=11,000 USDT\text{Opening Margin} = 6,000 + 5,000 = 11,000\ \text{USDT}Opening Margin=6,000+5,000=11,000 USDT

2. Average Opening Price

When a trader opens multiple positions, the system recalculates the average opening price using a weighted average:

Average Opening Price=∑(Contract Quantity×Price)∑Contract Quantity\text{Average Opening Price} = \frac{\sum (\text{Contract Quantity} \times \text{Price})}{\sum \text{Contract Quantity}}Average Opening Price=∑Contract Quantity∑(Contract Quantity×Price)​

Example

  • Position 1: 0.5 BTC at 5,000 USDT

  • Position 2: 0.3 BTC at 6,000 USDT

Total Value=(0.5×5,000)+(0.3×6,000)=2,500+1,800=4,300\text{Total Value} = (0.5 \times 5,000) + (0.3 \times 6,000) = 2,500 + 1,800 = 4,300Total Value=(0.5×5,000)+(0.3×6,000)=2,500+1,800=4,300
Total Quantity=0.5+0.3=0.8 BTC\text{Total Quantity} = 0.5 + 0.3 = 0.8\ \text{BTC}Total Quantity=0.5+0.3=0.8 BTC
Average Opening Price=4,3000.8=5,375 USDT\text{Average Opening Price} = \frac{4,300}{0.8} = 5,375\ \text{USDT}Average Opening Price=0.84,300​=5,375 USDT

3. Profit and Loss Calculation

The unrealized profit and loss (PnL) is shown in real time and calculated differently for long and short positions.

For Long Positions

PnL=Quantity×(Mark Price−Average Opening Price)\text{PnL} = \text{Quantity} \times (\text{Mark Price} - \text{Average Opening Price})PnL=Quantity×(Mark Price−Average Opening Price)

Example:

  • Quantity: 0.2 BTC

  • Opening Price: 7,000

  • Mark Price: 7,500

PnL=0.2×(7,500−7,000)=100 USDT\text{PnL} = 0.2 \times (7,500 - 7,000) = 100\ \text{USDT}PnL=0.2×(7,500−7,000)=100 USDT

For Short Positions

PnL=Quantity×(Average Opening Price−Mark Price)\text{PnL} = \text{Quantity} \times (\text{Average Opening Price} - \text{Mark Price})PnL=Quantity×(Average Opening Price−Mark Price)

Example:

  • Quantity: 0.4 BTC

  • Opening Price: 6,000

  • Mark Price: 5,000

PnL=0.4×(6,000−5,000)=400 USDT\text{PnL} = 0.4 \times (6,000 - 5,000) = 400\ \text{USDT}PnL=0.4×(6,000−5,000)=400 USDT
PreviousLadder Maintenance Margin RateNextCoin Margined Perpetual Contracts

Last updated 1 month ago