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

Kraken: Multiple Deposits might be out of order #87

Closed
uvok opened this issue Nov 21, 2021 · 4 comments
Closed

Kraken: Multiple Deposits might be out of order #87

uvok opened this issue Nov 21, 2021 · 4 comments

Comments

@uvok
Copy link
Contributor

uvok commented Nov 21, 2021

Currently, the Kraken exchange code expects deposit to always come in pairs.

However, I just had an occurrence where the deposit looked like this:

-- -- -- -- -- -- -- -- -- --
  QYY 2021-11-18 16:59:25 deposit   currency ZEUR 400 0  
  QXX 2021-11-18 17:10:00 deposit   currency ZEUR 401 0  
LXX QXX 2021-11-18 17:12:54 deposit   currency ZEUR 401 0 mmm
LYY QYY 2021-11-18 18:01:57 deposit   currency ZEUR 400 0 nnn

I think this should be supported as well? What do others think?

@uvok
Copy link
Contributor Author

uvok commented Nov 21, 2021

Running it resulted in an assertionerror:

2021-11-21 14:18:12,456 book         INFO     Reading file from exchange kraken_ledgers at /home/uvok/python-environments/bitpanda/CoinTaxman/account_statements/ledgers.csv-filtered.csv
Traceback (most recent call last):
  File "/home/uvok/python-environments/bitpanda/CoinTaxman/src/main.py", line 44, in <module>
    main()
  File "/home/uvok/python-environments/bitpanda/CoinTaxman/src/main.py", line 32, in main
    status = book.read_files()
  File "/home/uvok/python-environments/bitpanda/CoinTaxman/src/book.py", line 821, in read_files
    self.read_file(file_path)
  File "/home/uvok/python-environments/bitpanda/CoinTaxman/src/book.py", line 776, in read_file
    read_file(file_path)
  File "/home/uvok/python-environments/bitpanda/CoinTaxman/src/book.py", line 498, in _read_kraken_ledgers
    assert dup_state["deposit"] == 0, (
AssertionError: Orphaned deposit. (Must always come in pairs). Is your file corrupted?

@uvok
Copy link
Contributor Author

uvok commented Nov 21, 2021

Never mind, my mistake.

The offending deposit was staking-related.

@uvok uvok closed this as completed Nov 21, 2021
@Griffsano
Copy link
Contributor

@uvok I'm having a similar problem. What did you do to resolve this problem?

It looks like all the rows that should be of type "reward" are actually of type "deposit" in the CSV. Also, transfers between staking and spot are each listed as withdrawal, deposit and 2x transfer. Therefore, the operation mapping book.py causes wrong actions for my CSV export. Do you have the same behavior?

This site lists all possible types in the CSV, but it seems to be outdated:
https://support.kraken.com/hc/en-us/articles/360001169383-Explanation-of-Ledger-Fields

@uvok
Copy link
Contributor Author

uvok commented Dec 17, 2021

@Griffsano Uh, I filtered the CSV manually, removing all "problematic" transactions:

  • Margin Trades
  • Staking Withdrawals / Deposits.

So yeah, I have the same behavior.

I initially thought what was causing the problems was an out-of-order deposit of fiat, but it was indeed the Staking

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

No branches or pull requests

2 participants