This guide explains how to calculate profit and loss (PnL), return on investment, and average entry price for USDT-margined perpetual contracts on All InX.
1️⃣ PnL Ratio Calculation
Long Position PnL Ratio = ((Closing Price - Opening Price) / Opening Price) * Leverage * 100%
Short Position PnL Ratio = ((Opening Price - Closing Price) / Opening Price) * Leverage * 100%
2️⃣ Profit Calculation
Unrealized PnL (excluding funding fees and trading fees):
Long Position Profit = (Closing Price - Average Entry Price) * Contract Quantity * Contract Size
Short Position Profit = (Average Entry Price - Closing Price) * Contract Quantity * Contract Size
Realized PnL (including funding fees and trading fees):
Realized PnL = Closing PnL - (Total Fees)
Total Fees = Opening Fee + Closing Fee + Funding Fee
3️⃣ Average Entry Price Calculation
Average Entry Price = Position Value / (Contract Size * Total Contract Quantity)
Position Value = [(Contract Size * Quantity1 * Price1) + (Contract Size * Quantity2 * Price2) + (Contract Size * Quantity3 * Price3) + …]