provinzio / CoinTaxman

Calculate your taxes from cryptocurrency gains
GNU Affero General Public License v3.0
141 stars 31 forks source link

Unmatched buy/sell position - XMR on Binance #102

Closed oldgitdaddy closed 2 years ago

oldgitdaddy commented 2 years ago

When running src/main.py on a transaction history from Binance, I get the following error:

-25295698d7ef-c000.csv: Line 3: Not enough XMR in queue to sell: missing 0.46683                                       941 XMR (transaction from 2021-11-17 18:06:21+00:00 on binance)
        This error occurs if your account statements have unmatched buy/sell pos                                       itions.
        Have you added all your account statements of the last years?
        This error may also occur after deposits from unknown sources.

Traceback (most recent call last):
  File "/home/pi/CoinTaxman/src/main.py", line 44, in <module>
    main()
  File "/home/pi/CoinTaxman/src/main.py", line 38, in main
    taxman.evaluate_taxation()
  File "/home/pi/CoinTaxman/src/taxman.py", line 260, in evaluate_taxation
    self._evaluate_taxation_per_coin(operations)
  File "/home/pi/CoinTaxman/src/taxman.py", line 249, in _evaluate_taxation_per_                                       coin
    self.__evaluate_taxation(coin, coin_operations)
  File "/home/pi/CoinTaxman/src/taxman.py", line 169, in _evaluate_taxation_GERM                                       ANY
    if tx_ := evaluate_sell(op):
  File "/home/pi/CoinTaxman/src/taxman.py", line 98, in evaluate_sell
    raise RuntimeError
RuntimeError

Background: I started my trading history in XMR, which appears to be the transaction causing this error. Any hints on this one?

provinzio commented 2 years ago

You can only sell what you got. This error states, that you are selling something, which you doesn't have according to your account statements OR for which now buy information exist.

e.g.

DEPOSIT 1 XMR
SELL 1 XMR FOR 1 EUR

The program can not tell, how much gain you realized, because the buying date and buying price is missing. The error gets raised. You need to add the account statement from/where you bought the 1 XMR to avoid the error.

Please share your account statements/transactions, so that we can help you narrow down the problem.

oldgitdaddy commented 2 years ago

From my understanding, I started my binance account with transferring XMR and no Fiat money. The first lines of my transaction file below, which cause the error.

User_ID,UTC_Time,Account,Operation,Coin,Change,Remark
1,2021-11-10 18:02:41,Spot,Deposit,XMR,0.46683941,""
1,2021-11-10 18:06:21,Spot,Large OTC trading,XMR,-0.46683941,""
1,2021-11-10 18:06:21,Spot,Large OTC trading,USDT,113.52694140,""
scientes commented 2 years ago

Yes but when and at what price did you obtain those xmr. This Information is needed for the tax calculation

oldgitdaddy commented 2 years ago

So I bought this amount on kraken and transferred it through another wallet to binance. So how should I tweak the csv to generate the report?

scientes commented 2 years ago

Change the deposit into a buy and change the Date of that to the time when you bought on Kraken.

provinzio commented 2 years ago

...And remove the buy from your kraken transaction.

This is a dirty fix which you have to use right know. #4 tackles this issue.