To calculate the Realised Profit and Loss (Realised PNL) you see on the Balances page, you will need to account for all of the trades that you’ve made within that 24 hour period, between 12:00 PM UTC and 12:00 PM UTC the next day.


For example, to calculate the July 9th Realised PNL (0.00067113 XBT) shown below:


We’ll have to account for the trades that were made between July 8th 12:00 PM UTC and July 9th 12:00 PM UTC as shown on the Trade History page: 



Order f978439 from the screenshot above was partly closed with 69f67a7 so that’s the first pair of trades we’ll need to calculate the Unrealised PNL for using the following formula: 


Unrealised PNL = Number of Contracts * Multiplier * (1/Average Entry Price - 1/Exit Price)

* The (1/Price) values will need to be rounded to 8 decimal places for accuracy 


UnrealisedPNL = 390 * 1 * (1/9349.0 - 1/9490.0)

= 390 * 1 * (0.00010696 - 0.00010537)

= 0.0006201 XBT 


You can double-check that you’ve calculated the UnrealisedPNL correctly by using the BitMEX calculator.


Now that we got the Unrealised PNL, we can use the formula below to calculate Realised PNL for those trades:

Realised PNL = Unrealised PNL - taker fee + maker rebate -/+ funding payment 

Realised PNL = 0.0006201 - 0.00010428 + 0.00001027 

= 0.00052609 XBT 


The remainder of f978439 was fully closed with 9b21c0f within that 24 hour period, so we will have to calculate the PNL for this pair as well:

Unrealised PNL =  910 * 1 * (1/9349.0 - 1/9371.0)

= 910 * 1 * (0.00010696 - 0.00010671) 

= 0.0002275 XBT


Realised PNL = 0.0002275 - 0.00007282

= 0.00015468 XBT 


To put it all together and get the total RealisedPNL for July 9th, we will have to add the Realised PNL for the two pairs of trades and the funding payment that was paid during this time: 


July 9th Realised PNL = Realised PNL for trade f978439 & 69f67a7 + Realised PNL for f978439 & 9b21c0f - funding payment

= 0.00052609 + 0.00015468 - 0.00000964

= 0.00067113 XBT