Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle deposits from unknown sources? #130

Open
tobias-p opened this issue May 14, 2022 · 19 comments
Open

How to handle deposits from unknown sources? #130

tobias-p opened this issue May 14, 2022 · 19 comments

Comments

@tobias-p
Copy link

tobias-p commented May 14, 2022

Got a warning about an unresolved deposit, right after that warning the app exits with an error. How can someone handle this to resolve the warning and get the export?
EDIT: Added the Traceback and Lines of Warning and Error

2022-05-14 17:40:04,448 taxman       WARNING  Unresolved deposit of 2.91276799 CELO on binance at 2021-03-20 10:22:33+00:00. The evaluation might be wrong.
2022-05-14 17:40:04,449 taxman       ERROR    part-00000-7335b960-2dd4-42b2-bffe-146aede6f851-c000.csv: Line 22: Not enough CELO in queue to sell: missing 2.91000000 CELO (transaction from 2021-03-20 10:39:01+00:00 on binance)
        This error occurs if your account statements have unmatched buy/sell positions.
        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 "D:\CoinTaxman-main\src\main.py", line 54, in <module>
    main()
  File "D:\CoinTaxman-main\src\main.py", line 43, in main
    taxman.evaluate_taxation()
  File "D:\CoinTaxman-main\src\taxman.py", line 273, in evaluate_taxation
    self._evaluate_taxation_per_coin(operations)
  File "D:\CoinTaxman-main\src\taxman.py", line 258, in _evaluate_taxation_per_coin
    self.__evaluate_taxation(coin, coin_operations)
  File "D:\CoinTaxman-main\src\taxman.py", line 177, in _evaluate_taxation_GERMANY
    if tx_ := evaluate_sell(op):
  File "D:\CoinTaxman-main\src\taxman.py", line 106, in evaluate_sell
    raise RuntimeError
RuntimeError
@tobias-p
Copy link
Author

tobias-p commented May 14, 2022

Another error I currently run in is within the current coinbase export...

Here's the traceback:

Traceback (most recent call last):
  File "D:\CoinTaxman-main\src\main.py", line 54, in <module>
    main()
  File "D:\CoinTaxman-main\src\main.py", line 36, in main
    status = book.read_files()
  File "D:\CoinTaxman-main\src\book.py", line 1334, in read_files
    self.read_file(file_path)
  File "D:\CoinTaxman-main\src\book.py", line 1289, in read_file
    read_file(file_path)
  File "D:\CoinTaxman-main\src\book.py", line 406, in _read_coinbase_v2
    self._read_coinbase(file_path=file_path)
  File "D:\CoinTaxman-main\src\book.py", line 324, in _read_coinbase
    eur_subtotal = misc.force_decimal(_eur_subtotal)
  File "D:\CoinTaxman-main\src\misc.py", line 89, in force_decimal
    raise ValueError(f"Could not parse "{d}" to decimal")
ValueError: Could not parse "None" to decimal

@provinzio
Copy link
Owner

Another error I currently run in is within the current coinbase export...

Here's the traceback:

Traceback (most recent call last):
  File "D:\CoinTaxman-main\src\main.py", line 54, in <module>
    main()
  File "D:\CoinTaxman-main\src\main.py", line 36, in main
    status = book.read_files()
  File "D:\CoinTaxman-main\src\book.py", line 1334, in read_files
    self.read_file(file_path)
  File "D:\CoinTaxman-main\src\book.py", line 1289, in read_file
    read_file(file_path)
  File "D:\CoinTaxman-main\src\book.py", line 406, in _read_coinbase_v2
    self._read_coinbase(file_path=file_path)
  File "D:\CoinTaxman-main\src\book.py", line 324, in _read_coinbase
    eur_subtotal = misc.force_decimal(_eur_subtotal)
  File "D:\CoinTaxman-main\src\misc.py", line 89, in force_decimal
    raise ValueError(f"Could not parse "{d}" to decimal")
ValueError: Could not parse "None" to decimal

Fixed in the commit above.

@provinzio
Copy link
Owner

provinzio commented May 14, 2022

Got a warning about an unresolved deposit, right after that warning the app exits with an error. How can someone handle this to resolve the warning and get the export?

CoinTaxman is literally asking: "from where do these coins come from? When and for which price were they bought?" Because you are selling them according to FIFO and the tool can not determine the tax when buying time (is it in speculation period? is it taxable?) and price (calculation of gain) are unknown.

To resolve this, you have to add all your account statements; especially in this case the corresponding withdrawal of 2.91276799 CELO. If the other exchange from where these coins come from is currently not supported, you can use the custom account statements format, which is currently only available in the branch rework-evaluation-export. Checkout custom_eur in book.py and our Wiki page regarding the custom import.

These account statements should have at least a

  • Buy 2.91276799 CELO for X EUR at Y utc_time
  • Withdrawal 2.91276799 CELO at 2021-03-20 10:22:33+00:00 (deposit on binance) or before this, but after the buy time Y

Does this solve your problem? Feel free to ask questions.

@provinzio
Copy link
Owner

@tobias-p btw, I am currently reworking the evaluation and export. Feel free to checkout the branch rework-evaluation-export (#127). :)

@tobias-p
Copy link
Author

tobias-p commented May 14, 2022

Got another Traceback for an Error in Coinbase

Traceback (most recent call last):
  File "D:\CoinTaxman-main\src\main.py", line 54, in <module>
    main()
  File "D:\CoinTaxman-main\src\main.py", line 36, in main
    status = book.read_files()
  File "D:\CoinTaxman-main\src\book.py", line 1340, in read_files
    self.read_file(file_path)
  File "D:\CoinTaxman-main\src\book.py", line 1295, in read_file
    read_file(file_path)
  File "D:\CoinTaxman-main\src\book.py", line 412, in _read_coinbase_v2
    self._read_coinbase(file_path=file_path)
  File "D:\CoinTaxman-main\src\book.py", line 403, in _read_coinbase
    raise NotImplementedError(f"unknown operation type {operation}")
NotImplementedError: unknown operation type Deposit

Feel free to checkout the branch rework-evaluation-export (#127). :)

i've not used github that much, could you tell me how to download the specific branch?

EDIT: Nevermind, donwloaded the github desktop app and cloned the project.. could now check out the rework-evaluation-export branch

@provinzio
Copy link
Owner

provinzio commented May 14, 2022

Thanks for your feedback. That might be the reason, you are missing deposits... Have to look into that.


Do you use git to clone the repo or did you downloaded it as zip? I'd recommend to use git for that and can recommand Visual Studio Code to handle git.

  1. Install git https://git-scm.com/
  2. Install Visual Studio Code (VSC) https://code.visualstudio.com/
  3. Open Visual Studio Code, left side "Extensions": install Git Graph
    Now clone a fresh version of CoinTaxman. Right click somewhere where you want to have the folder. Select Git Bash here which should be new from your git installation
  4. Run the command git clone https://github.com/provinzio/CoinTaxman.git to download the newest version.
    Now open VSC and navigate to the newly created folder:
  5. Open VSC. File > Open Folder... > Select the newly created folder
  6. Left side top most symbol "Explorer" shows you the files in that folder
  7. Left side third symbol from above "Source control" lets you manage git. Click on that...
  8. See the picture below, thats the Git Graph icon. Click on that to see the history of the repository.

grafik

  1. top right is a cloud icon with arrow down "Fetch from Remote(s)". This gets you the newest information from the server without changing your files
  2. The history consists of single commits/"changes" (each line is a commit). The different colored lines show you the history path of a "branch". each branch is a different "main version" of the Software. "main" is the "master version" of the software, this is that everyone is using. I am currently working on rework-evaluation-export. As this is a work in progress, it is not part of the master version. The version you are currently on is bold. This should be main right now.
  3. You are able to change the "version" of your files by checking out to another branch. Rightclick on the name of a branch > Checkout Branch
  4. You successfully changed the version of your files. The other branch should now be bold. You changed to that one.

Btw on the left hand side of the Source Control Tab, you can see your changed files. It's possible to mark these changes and push them to the server, to contribute your changes directly. But thats a topic for sometimes else, if you are interested in that.

@tobias-p
Copy link
Author

Thanks for your feedback. That might be the reason, you are missing deposits... Have to look into that.

I think that in the code the deposit part is missing for coinbase... probably there should be something for mining rewards too, since all of the coins I've received there via deposit where because of mining IIRC..1

Do you use git to clone the repo or did you downloaded it as zip?

I downloaded and installed the github app... so there's an easy way to change between the branches... also can check out which changes were made with each commit within the app and for the little changes of the code I use sublime...

Doing changes and pushing them would be a possible option in near future, but atm I've got just little experience with python and git..

@provinzio
Copy link
Owner

I think that in the code the deposit part is missing for coinbase... probably there should be something for mining rewards too, since all of the coins I've received there via deposit where because of mining IIRC..1

Are you able to fix this yourself? I am not a coinbase user myself. So debugging this is kind of annoying without test account statements. Adding the missing deposit operation should be the easiest fix, but dunno whether more is missing.

I downloaded and installed the github app... so there's an easy way to change between the branches... also can check out which changes were made with each commit within the app and for the little changes of the code I use sublime...

Doing changes and pushing them would be a possible option in near future, but atm I've got just little experience with python and git..

That works, too. :)

@tobias-p
Copy link
Author

tobias-p commented May 14, 2022

Are you able to fix this yourself?

atm it would be easier to hand over my csv to you for testing purposes (since I have no time atm to read into the whole code to understand everything - thats something I can probably do in about 3-4 months)...

my file should be availabe with this comment

Edit: removed by @provinzio

@provinzio
Copy link
Owner

provinzio commented May 14, 2022

@tobias-p Have you changed or resaved the file with Excel or something like that? Excel is aweful in csv-handling...

I am not able to import your given file. It looks like to format is broken.

@tobias-p
Copy link
Author

damn, you're right, i changed the mail within excel... sorry... I will re upload a file were I did the changes via sublime..

@tobias-p
Copy link
Author

tobias-p commented May 14, 2022

Couldn't Edit my previous post with the file, so here it is - and it should be not broken this time

Edit: removed by @provinzio

@provinzio
Copy link
Owner

provinzio commented May 14, 2022

Thank you for sharing your coinbase account statement. I did some changes and reverted a stupid commit from me earlier...
Please checkout 130-how-to-handle-deposits-from-unknown-sources. Does this fix your problem?

On rework-evaluation-export, the Coinbase.csv does end in an error Not enough BHC in queue to sell, because the source of these coins is not given. This error is supposed to happen, as it's unclear from your account statement, from when these BCH come.

Can I keep the file for further testing (I won't give it to somebody else without your permission) or shall I delete it?

@tobias-p
Copy link
Author

Can I keep the file for further testing (I won't give it to somebody else without your permission) or shall I delete it?

Yeah sure, keep it as long as it is helpful to you! I'm glad to found a program where I don't have to enter my ~ 40k lines from Binance :)

On rework-evaluation-export, the Coinbase.csv does end in an error Not enough BHC in queue to sell, because the source of these coins is not given. This error is supposed to happen, as it's unclear from your account statement, from when these BCH come.

I can tell you, that I got those because of the fork of BCH from BTC... Seems like Coinbase doesn't added this in their csv... maybe this could be added manually as a row? I will check out, when I received the BCH

@provinzio
Copy link
Owner

provinzio commented May 14, 2022

I can tell you, that I got those because of the fork of BCH from BTC... Seems like Coinbase doesn't added this in their csv... maybe this could be added manually as a row? I will check out, when I received the BCH

Adding this by hand sounds reasonable. I'd recommend you to create a new file coinbase-additional.csv which has the same header as Coinbase.csv but just this single transaction to convert BTC to BHC. To keep the original account statement file separate from the custom adjustments you need to make.

@tobias-p
Copy link
Author

tobias-p commented May 14, 2022

just this single transaction to convert BTC to BHC
That's no problem, did that!

Thank you for sharing your coinbase account statement. I did some changes and reverted a stupid commit from me earlier...
Please checkout 130-how-to-handle-deposits-from-unknown-sources. Does this fix your problem?

tried to use your rework-evaluation branch, but got a lot of missing libs (didn't got this right away)... Now coinbase import seemed to work, binance import is on the go...

Since your app needs some time while calling the binance data, I think I can report tomorrow the outcome of everything 😉 will check everything then and try to give more input to you...

BTW, is the debug-data (complete, warnings only, other statements except the normal price data call) shown in the powershell automatically written into a log file?

@provinzio
Copy link
Owner

provinzio commented May 14, 2022

Awesome. I am currently testing only your Coinbase.csv which raises some more unrelevant errors at the end. It's already fixed on rework-evaluation-export.

These errors should appear for you too after you fetched all prices. Please pull my fixes first in that case. :)

@provinzio
Copy link
Owner

I can tell you, that I got those because of the fork of BCH from BTC... Seems like Coinbase doesn't added this in their csv... maybe this could be added manually as a row? I will check out, when I received the BCH

regarding your fork. we might want to add this not as buy/sell conversion, but as a new class type fork, which could be listed as that in the export and so one. feel free to open an issue/pr if this is interesting for you

@tobias-p
Copy link
Author

open an issue/pr

opened an issue, it's a nice idea...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants