Missing information for Tax Reporting (FIFO)?

Hi there!
I am trying to get a tax report together. What I basically need is to determine for each asset SELL what the difference between the SELL price and the BUY price is using a FIFO calculation.

For this purpose I queried the Spot Trading / Account Trade List to get all my trades. Is this the right way to go?

I found that I miss vital information in this list. I have no price information of the fee if it is paid with BNB!

Consider a transaction to SELL bitcoin. I have a BTC amount and a BTC price. That’s perfect. I can calculate with that. But then I have a commission paid in BNB and I only have a BNB amount. With the amount alone I cannot determine the price of BNB at the point of trade.
I either need the price of BNB (in my case in EUR, but it could also be in the traded currency, BTC) or I need the percentage of the fee relative to the traded amount. Then I could simply multiply the BTC amount with the fee percentage and the BTC price and voila, I would have the value of the BNB fee in EUR.
As I was crossing certain Binance VIP levels and therefore my fee percentages have changed over time I cannot be certain what were the maker/taker fees at the time of the trade. Is there a way to find out the VIP level at the point of trade?)

I also tried downloading the transaction history, trade history and order history CSV data from Binance, but there I also could not find the missing link.

Any idea how to solve this issue?

Is this the right way to go?

Yes this is the correct approach.

I either need the price of BNB (in my case in EUR, but it could also be in the traded currency, BTC) or I need the percentage of the fee relative to the traded amount.

Neither of the two suggested solutions are available via the API.

Is there a way to find out the VIP level at the point of trade?)

There is no endpoint for historical VIP data.

Any idea how to solve this issue?

If your goal is to calculate the aggregated profit/loss of all symbols for taxation purposes, you should only consider price * qty as qty includes the commission quantity also.

Example

BUY 0.1 BTC @ 45000 USDT | PNL = -4500
SELL 0.099 BTC @ 50000 USDT | PNL = -4500 + 4950 = 450

Yes, PNL for taxation is the goal. However your Example solves only half of the issue.

Example:
BUY 100 BNB @ 300 USDT, PNL = -3000
BUY 0.1 BTC @ 45000 USDT, PNL = -4500
SELL 0.99 BTC @ 50000 USDT, PNL = -4500 + 4950 = 450
The SELL BTC however includes a SELL BNB as well, as the fee was paid in BNB:
SELL 0.01285 BNB @ ??? USDT, PNL = -(0.01285*300) + ??? = ???

Your scenario is correct if your intentions are to calculate the PNL of each asset individually. You will require the kline endpoint for historical BNB pricing.


On the other hand, if your intentions is to reach a total PNL of the account, irrelevant of the individual asset PNL, then you can work off the trades endpoint only since the EUR equivalent of BNB commission and the standard quote asset commission are the same, and is included in the quantity value.

I tried to use kline, but if I am not mistaken it only holds data for 200 days. As I need to calculate taxes for 2020 and 2021, 200 days is not sufficient.

According to German tax law, the assets should to be listed individually. An overall PNL figure would be a good start, though… but I did not understand your reply. What do you mean by ‘standard quote asset commission’?

Maybe our definition for PNL are not the same? What I mean by PNL is the surplus or loss that occurs when SELLING or USING/PAYING WITH a crypto asset. Every time an asset is SOLD, the PNL of that transaction is defined as selling price minus buying price.

So, the amount of crypto you are still holding in your wallet is irrelevant. Only when a SELL occurs, a PNL occurs. Therefore I need to be able to calculate back to EUR for every sale/use of an asset.

If I could get a global PNL and not per asset, that would not be ideal but it would also help me. However, I fail to understand how price * qty could help. The idea to multiply price and qty seems to work only if the fee is paid in the asset currency. But my example is that I sell BTC and pay a BNB fee. In that case, the BNB qty is separate and not included in the BTC qty… If I would know the fee qty in BTC or EUR, I would be fine.

I tried to use kline, but if I am not mistaken it only holds data for 200 days.

This is not correct. The API offers kline data since the day the symbol has been listed on the exchange.


Have a look at the documentation here

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data

When a trade uses BNB commission, look up the BNB price at that date using the Kline endpoint.


However, note that kline provides the open and close price of symbol not the exact price used to calculate commission. Therefore the accuracy depends on the volatility of the market during that minute.

This is the most accurate way to calculate the fiat equivalent of BNB commission, assuming you did not manually record the price of BNB the moment of the trade.