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

Bitpanda changed fileformat #165

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on May 11, 2024

  1. Fixed changed bitpanda fileformat; added handling for some transfers;…

    … small cfg fix
    
    * cfg fix: The de_DE locale doesn't work on my system. I've changed it to try different locales in order ("de_DE", "de_DE.utf-8")
    * general: Created AirdropGift (non-taxed) and AirdropIncome (taxed) as subclasses of Airdrop. AirdropGifts are always non-taxed and AirdropIncome are always taxed, no matter the setting `ALL_AIRDROPS_ARE_GIFTS` in the config. These subclasses can be used if it is save to say that a record is to be taxed or not.
    * bitpanda general: Current csv exports have an additional field that tripped up the parsing. Added the field `_tax_fiat` to the header definition. TODO: check if the contained information is relevant.
    * bitpanda airdrop types: Implemented AirdropGift for BEST and ETHW drops (see below).
    * bitpanda stocks: Ignore records where the asset type starts with "Stock" (for now)
    * bitpanda BEST transfer: BEST is bitpandas own coin and is rewarded for activity and holding a portfolio. These are classified as AirdropGift (non-taxable).
    * bitpanda ETHW transfer: ETHW is the old ETH chain. If a user held ETH with bitpanda when the fork to PoS happened, they received ETHW some time in September 2022. Classify that as AirdropGift according to the first reasoning described [here](https://www.winheller.com/bankrecht-finanzrecht/bitcointrading/bitcoinundsteuer/besteuerung-hardforks-ledger-splits.html)
    * bitpanda staking: Implemented handling of staking for `transfer(stake)` and `transfer(unstake)` operation types.
    wullxz committed May 11, 2024
    Configuration menu
    Copy the full SHA
    8c67d26 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2024

  1. Bitpanda: fixes for unobtainable prices for ETHW and BEST

    Background info: Bitpanda Pro, which is used to obtain historical prices for (crypto-)assets
    is now ONE TRADING and a separate company to which Bitpanda only holds a minority stake.
    After that split, BEST can't be used anymore on ONE TRADING and historical BEST price data isn't available anymore.
    Also, ETHW, which stands for the Proof of Work branch of the ETH chain, isn't available on ONE TRADING.
    
    This means, that we need to use the prices we have from the csv file as best as we can.
    For normal transactions, that's possible by using the "Asset market price" column of the export but for fee withdrawals
    from the BEST wallet, no price was actually associated with the withdrawal transaction.
    For now, I'm using an asset price of 0 because I don't know how to fix this otherwise.
    
    For the normal transactions, a new property has been added to the Operation class (`exported_price`) to be able to
    carry the asset price for normal transactions into the processing classes like PriceData and use it there
    if a proper price can't be obtained (see `get_cost` method in `PriceData` in price_data.py).
    
    Source: https://support.bitpanda.com/hc/en-us/articles/9374684386332-Why-is-Bitpanda-Pro-evolving-to-become-One-Trading
    
    * general: Added new data field `exported_price` to `Operation` class
    * bitpanda general: For ETHW and BEST, the `exported_price` will be used because the ONE TRADING API doesn't return anything.
    * bitpanda general fix: The `change` calculation used a change from an earlier data record for some operation types,
      because the `change` variable was not touched (for Airdrops of any kind and Staking operations of any kind).
      The missing operations are now added in `_read_bitpanda` in book.py and an Exception has been added for anything else not
      included in my change.
    wullxz committed May 12, 2024
    Configuration menu
    Copy the full SHA
    5eca87e View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. Fixes in bitpanda price fetching; more special case handling

    * bitpanda general: Bitpanda Pro, whose API we use to fetch prices for bitpanda transactions, is now One Trading. As a result, their API is available under a different address and with a slightly different response. This commit contains the fixes for both, the address and the parsing/usage of the result.
    * bitpanda general: Since One Trading doesn't offer the same coins as Bitpanda anymore, some coin/fiat pairs aren't available there (like BEST/EUR, ETHW/EUR, LTC/EUR and others). To differentiate between a "market" not being available and other errors, we raise a ValueError in case the "market" is not available. I chose ValueError because catching LookupError also catches errors with indices in lists, which should be thrown.
    * bitpanda general: The ValueError is caught in price_data.py in the `get_cost` method. In the last commit, I added a new field `exported_price` to the `Operation` data class, which is used in the exception handling to use the price from the csv export (it's better than nothing). For BEST, there is sadly no price available if the BEST transaction is a Withdrawal (Fee). For now, we assume a value of 0 in that case (I don't know how to fix this otherwise).
    * bitpanda LUNC airdrop: I added special handling for the LUNC airdrop that happened in May 2022 because of a blockchain crash and subsequent fork. Sadly, the price can't be retrieved using the API and the airdrop didn't have a price associated. CoinTaxman should throw an exception because it can't fetch a price and it should also say which line the airdrop is in. I used that to edit my csv export and input a ridiculously small price since the price was really low anyway.
    * bitpanda staking rewards: Sometime before 2022/6/14, bitpanda used "transfer" for staking rewards. Incoming crypto "transfers" before that date, that aren't BEST, are therefore classified as (staking-)reward.
    wullxz committed May 13, 2024
    Configuration menu
    Copy the full SHA
    46b8abe View commit details
    Browse the repository at this point in the history