BitMEX trading gains show incorrect cost basis

All transactions imported via BitMEX APIs are showing trading loss in the Send column, and trading gains in the received column. Losses correctly show a difference between cost basis and value, and indicate the loss amount. Trading gains are showing as buys, with cost basis = current value.

These are margin trades, and the system does not appear to be understanding these correctly.

Thanks for flagging here. Could you share what you see on BitMEX and what you’d expect to be seeing here? We’d love to help get to the bottom of this ASAP

There are a couple of things to note:

  1. The time is always reported as 12:00 UTC. I assume this is because the time is not included in the API, or not in a format that is being recognized.
  2. Fees are not being reported.
  3. The trades themselves are not being reflected, just in/out of the BTC wallet. But this doesn’t really matter, as long as the amounts in/out of the BTC wallet are accurate.
  4. Balance remaining in the info tooltip is incorrect. But this may be due to incomplete data, and other transactions not being reflected properly.

The transactions shown in CoinTracker line up with the Transaction History in BitMEX (showing RealizedPnL and deposits/withdrawals.

Here’s an example set of transactions from the past couple days, first in BitMEX’s history, and then in CoinTracker:

The loss shows as a Send, and indicates “Trading Loss”, yet calculates as a gain due to the cost basis. The profits show as Receive, with the “Trading Gain” icon. But the value and cost basis are the same on several. The top item, a $50 gain, has a cost basis of $0.49!

Thanks for flagging this. Do you mind shooting us a note on support chat so that we can take a look at your BitMEX transactions and ensure that they are being calculated correctly?