provinzio / CoinTaxman

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

Other types than Spot are currently not supported. Please create an Issue or PR. #58

Closed igi01 closed 3 years ago

igi01 commented 3 years ago

I exported only spot history on binance, however on spot i traded leveraged tokens. Are these unsupported?

X:\CoinTaxman-main\src>python main.py 2021-08-14 21:22:26,286 book INFO Reading file from exchange binance at X:\CoinTaxman-main\account_statements\part-00000-85c9025f-e4d2-44c5-8858-8dc0d18f126e-c000.csv Traceback (most recent call last): File "X:\CoinTaxman-main\src\main.py", line 44, in main() File "X:\CoinTaxman-main\src\main.py", line 32, in main status = book.read_files() File "X:\CoinTaxman-main\src\book.py", line 766, in read_files self.read_file(file_path) File "X:\CoinTaxman-main\src\book.py", line 721, in read_file read_file(file_path) File "X:\CoinTaxman-main\src\book.py", line 107, in _read_binance assert account == "Spot", ( AssertionError: Other types than Spot are currently not supported. Please create an Issue or PR.

scientes commented 3 years ago

Leveraged tokens should work to my knowledge, but throw an error because their type is Set to a non Spot type in the Spot history and currently if a non Spot type is found we fail automatically. Changing the type to Spot could be a workaround for now until more types are supported. But i have Not tested this so this may Not work as intended. If you could provide us with example rows from the history for leveraged tokens this could be tested further

igi01 commented 3 years ago

Thanks for your reply. Here are the first lines from the spot history:

UTC_Time,Account,Operation,Coin,Change,Remark 2021-05-12 00:00:36,USDT-Futures,Referrer rebates,BNB,0.00000433,"" 2021-05-12 00:01:57,Spot,Fee,BNB,-0.00025714,"" 2021-05-12 00:01:57,Spot,Buy,RLC,24.00000000,"" 2021-05-12 00:01:57,Spot,Transaction Related,BTC,-0.00404808,"" 2021-05-12 00:03:07,USDT-Futures,Referrer rebates,BNB,5.1E-7,"" 2021-05-12 00:04:05,USDT-Futures,Referrer rebates,BNB,4.3E-7,"" 2021-05-12 00:04:21,Spot,Buy,DOTDOWN,89.14000000,"" 2021-05-12 00:04:21,Spot,Fee,BNB,-0.00008958,"" 2021-05-12 00:04:21,Spot,Transaction Related,USDT,-80.00315000,"" 2021-05-12 00:05:07,USDT-Futures,Referrer rebates,BNB,2.1E-7,"" 2021-05-12 00:06:06,USDT-Futures,Referrer rebates,BNB,0.00000122,"" 2021-05-12 00:07:50,Spot,Fee,BNB,-0.00051858,"" 2021-05-12 00:07:50,Spot,Buy,RLC,49.00000000,"" 2021-05-12 00:07:50,Spot,Transaction Related,BTC,-0.00809725,"" 2021-05-12 00:10:05,USDT-Futures,Referrer rebates,BNB,3.3E-7,"" 2021-05-12 00:10:05,USDT-Futures,Referrer rebates,BNB,8.2E-7,"" 2021-05-12 00:15:06,USDT-Futures,Referrer rebates,BNB,4.4E-7,""

What do you mean by changing the type to spot? If there are any keywords, what i should search for in the history please let me know.

Edit: i think the problem are the fees you need to pay when hodling a leveraged token: "2021-05-12 00:00:36,USDT-Futures,Referrer rebates,BNB,0.00000433,""". Is this correct?

scientes commented 3 years ago

Your Problem is not the leveraged Token, that works fine, the Problem are the referrer rebates. A Quick an dirty solution for you if you have some kind of deadline to meet would be to replace "USDT-Futures,Referrer rebates" with "Spot,Buy" in your Spot history(if my understanding is correct and rebates are the fee you get refunded, for being referred). If you Do that i would recommend making a copy of the original so you still have that and could easily revert the changes. Otherwise i will try and make a small fix for this Problem.

Coming from that you have future rebates, could you make a New issue for Futures with example entries from the future history (you can anonymise it if you want)

igi01 commented 3 years ago

Thank for this fix. Seems to work now.

Sadly, i used all 4 times per month from binance to generate a new history. I already have generated a history of all (Spot, future, ...) and only spot (however future is also included in there, see above). Does this also help or should i wait until next month and then submit the only future history?

scientes commented 3 years ago

If you have Spot and future and others in one would also suffice, also it does not have to be the whole file, a few rows should suffice. If applicable each Operation, the entry after the Account Name(USDT-Futures or Spot for example), should be included for non Spot Accounts at least once. If we have that implementing these would be easier.

igi01 commented 3 years ago

Sorry, i now realized, that somehow my refferal link is used by someone who is trading futures. I don't know how and why because i don't promote my account anywhere :D But well free money.

So this has nothing to do with the leveraged tokens, sorry for the confusion ...