Yield Calculation
Long position yield = [(closing price - opening price) / opening price] * leverage * 100%
Short position yield = [(opening price - closing price) / opening price] * leverage * 100%
Profit calculation
Calculation of profit and loss on closing position (excluding funding and transaction fees)
Long position profit = (closing price - average opening price) * contract quantity * contract face value
Short position profit = (average opening price - closing price) * contract quantity * contract face value
Realized profit and loss calculation (including funding and transaction fees)
Realized P&L = Closing P&L - (All Fees)
All fees = opening fee + closing fee + funding fee
Average opening price calculation
Average opening price = position value / (contract face value * total number of contracts)
Position Value = [(Contract Value * Quantity1 * Price1) + (Contract Value * Quantity2 * Price2) + (Contract Value * Quantity3 * Price3) + ....]