Formula
The Realised Profit and Loss (Realised PNL) on your Transaction History page represents the overall financial outcome of all your trades. It can include gains, losses, fees, and funding payments. The formula for calculating it depends on the contract type:
Unrealised PNL Calculation for Quanto and Linear Contracts
Quanto/Linear Unrealised PNL = # Contracts * Multiplier * (Exit Price - Entry Price)
Multiplier = Each contract has different multiplier. You can find each contracts' multiplier through the GET /instrument endpoint.
Unrealised PNL Calculation For Inverse Contracts
Unrealised PNL = Number of Contracts * Multiplier * (1/Average Entry Price - 1/Exit Price)
- Round the (100/Price) values to 8 decimal places for accuracy
- Multiplier = 1
Realised PNL Calculation for All Contracts
Realised PNL = Unrealised PNL - taker fee + maker rebate -/+ funding payment
Steps
To calculate your Realised PNL on BitMEX, you will need to account for all the trades you made at the time the PNL was realised. Here's a guide on how to manually calculate your Realised PNL:
-
Check the Trade History page to see the trades you made at that time.
- If unsure, verify the contract type you were trading by referring to the Contract's Guide: List of Contracts
-
Calculate the Unrealised PNL for each trade using the Unrealised PNL formula for the right contract type above.
- Double-check your Unrealised PNL calculation using the BitMEX calculator.
-
Calculate the Realised PNL for each trade using the Realised PNL formula above.
-
Add funding payment you received/paid at that time to get your total Realised PNL.
Example: manually calculating Realised PNL for XBTUSD
1. Check the Trade History page to see the trades you made within the 24-hour period
Let's say you want to calculate your Realised PNL for January 18th; you'll need to account for all trades made between January 17th, 12:00 PM UTC, and January 18th, 12:00 PM UTC.
After reviewing the Trade History page, you have the following trades that fall within that timeframe:
- Trade 1: Order e78e4a1 was partly closed with order 5403897
- Trade 2: The remainder of e78e4a1 was fully closed with afe5cda within that 24-hour period
2: Calculate the Unrealised PNL for each trade
Trade 1 (e78e4a1 partly closed with 5403897)
- Number of lots = 5
- Multiplier = 1
- Average Entry Price = 42292.5
- Exit Price = 42303
Unrealised PNL = Number of lots * Multiplier * (100/Average Entry Price - 100/Exit Price)
Unrealised PNL = 5 * 1 * (100/42292.5 - 100/42303)
Unrealised PNL = 5 * 1 * (0.00236449 - 0.0023639)
Unrealised PNL = 0.00000295 XBT
Trade 2 (rest of e78e4a1 closed with afe5cda)
- Number of lots = 15
- Multiplier = 1
- Average Entry Price = 42292.5
- Exit Price = 42107.5
Unrealised PNL = Number of lots * Multiplier * (100/Average Entry Price - 100/Exit Price)
Unrealised PNL = 15 * 1 * (100/42292.5 - 100/42107.5)
Unrealised PNL = 15 * 1 * (0.00236449 - 0.00237487)
Unrealised PNL = -0.0001557 XBT
3. Calculate the Realised PNL for each trade
Trade 1 (e78e4a1 partly closed with 5403897)
- Unrealised PNL = 0.00000295 XBT
- Taker fee = 0.00002954 XBT
Realised PNL = Unrealised PNL - Taker fee + Maker rebate
Realised PNL = 0.00000295 - 0.00002954
Realised PNL = -0.00002659 XBT
Trade 2 (rest of e78e4a1 closed with afe5cda)
- Unrealised PNL = -0.0001557 XBT
- Taker fee = 0.0000178 XBT
Realised PNL = Unrealised PNL - Taker fee + Maker rebate
Realised PNL = -0.0001557 - 0.0000178
Realised PNL = -0.0001735 XBT
4. Add up the Realised PNL for all trades and the funding payment
Total Realised PNL = Realised PNL for Each Trade +/- Funding Payment
Total Realised PNL for Jan 18th = Realised PNL for Trade 1 + Realised PNL for Trade 2 + Funding payment
Total Realised PNL = -0.00002659 - 0.0001735 + 0.00012685
Total Realised PNL = -0.00007324 XBT
The total Realised PNL for January 18th is -0.00007324 XBT which is also what's shown on the Transaction History page: