Hi together!
I created a Free Python Script to process your trade histories.I used the
outputfile of this tool for my
tax declaration, and thought it might help many people as well.
Therefore it would be great if this will result in a community project which everybody involved in Cryptos can
use for FREE.
The
logic & functionality should be
ready and next steps would be:
- testing
- creating gui or webapplication
- adding features
It would be
awesome if this could become some kind of
community project, on which we build
together a more complex, easier to use, tool for everybody (that does not know how to use python
Follow the HOWTO (below) and to calculate your profits etc.! If you run into any problems or if you need more exchanges write it in the comments and I will add them!
(I could only integrate the ones I use, cause I only got csv files from there)
The tool is working fine for me and I could perfectly calculate my profit, payed fees and last buy times to determine the 12 month holding time.
The code is not that complex, so take a look at it and feel free to add, correct or modify stuff and make sure to push it
--------------------------------------------------------------------------------------------------------------------
CryptoProfIT (Alpha Version)https://github.com/LucidSkyWalker/CryptoProfIT (Download here)
(Read here for nicer formatting)
https://github.com/LucidSkyWalker/CryptoProfIT/blob/master/README.mdThe profit result can be used to calculate the tax on your crypto.
The output are two csv-files. Example Screenshots can be found below.
The output files contain:
- Sorted full trade history (converts all exchange exports to the same formatting)
- Fees per Trade (inklusive Overall Payed fees)
- Profit per trade (Overall profit. This can be used to easily calculate your personal capital taxes)
- Profit can be calculated in EUR or USD. (Data from European Central Bank)
- Amount of your Cryptocurrencies
- Display the different BUY-INs by amount and date. So you can control the 12 month holding period.
Supported Exchanges: Binance, Bitfinex, Bittrex, Kraken, Mercatox, Poloniex, Costum*
*A dummy file is included that can be used to easily add trades of other exchanges.
If you give me a csv-file export from other exchanges (you can modify the digits for privacy) I will add them.
PLEASE READ: I wrote this tool to calculate my taxes and it did the job fine! Nevertheless it is not well tested yet. If you run into trouble, please write an issue and I will fix it! Thank you
Screenshots
https://user-images.githubusercontent.com/19948182/37256193-9a14af4a-2557-11e8-9844-2d3045653609.pngScreenshot of the output.csv. The data of all exchanges is formatted in its specific ways and displayed in a uniform style.
Type always refers to the first token of the pair! (First transaction shows buying XRP by BTC)
Base Price always refers to the second token of the pair.
Base Price in USD shows the price of the second token in USD.
https://user-images.githubusercontent.com/19948182/37256327-48d9386a-2559-11e8-9798-2d31e0ecc703.pngScreenshot of the holding_output.csv. This file can be used to specify your remaining holding times,
as Capital gains do not need to be taxed in many countries after 12 month
The picture shows (in red), that the first of the remaining ETH were bought on 2017-06-02, meaning that this amount is tax-free one year later.
The blue frame shows the date for the next tokens...
https://user-images.githubusercontent.com/19948182/37256205-bd9a468c-2557-11e8-9853-90d2f1daaa08.pngConsole output of the Python script (Not my real data
)
RequirementsFor now, there is no Gui so you have to use the python script.
If some dev likes to help, making a gui or a brython version would be neat.
HOWTO:Setting up Python: -Install Python 3.x (
https://www.python.org/downloads/)
-Make sure to mark "ADD PATH" in the installer
-Open commandline
-Type: "python --version", this should display "Python 3.x"
-Install package: "requests" (type: "pip3 install requests", hit ENTER) (if applicable, run commandline as admin)
-Install package: "pandas" (type: "pip3 install pandas", hit ENTER)
-Install package: "currencyconverter" (type: "pip3 install currencyconverter", hit ENTER)*
-Install package: "tables" (type: "pip3 install tables", hit ENTER)
Using the script: -Download or clone this git
-Download the historical price data file (
https://drive.google.com/open?id=1aiW2fq6sul4svVQp5iTqVXTdHn7vMMTh)
-Copy the file into the BTC_Data folder and overwrite existing fixed.hdf5
-Download the csv-file exports and copy them into the folder "trade_history_files"
Note: Binance will give you an excel file. Open that and save it as binance.csv
Note: For Kraken, use "trade" (not ledger) and mark "all"
-Rename the csv-files into the exchange names with lowercase. E.g. "kraken.csv", "binance.csv"...
-For further trades, copy the "dummy.csv" file from the "costum folder" into "trade_history_files".
(See section "Using a costum file". I used it for Anycoin and Liqui, as I could not get csv files there)
-Start the "main.py"
(Detailed: navigate via commandline into the "CryptoTaxator" folder
e.g type: "cd C:/CryptoTaxator", hit Enter, type: "Python3 main.py")
If you choose EUR, decimals in the output will be seperated with ",", for USD with "." (For proper Excel display)
-Forks are displayed with a warning, as you try to sell tokens you never bought before. Please read the Fork information if your trade history contains forks.
* This package uses the European Central Bank as source for EUR/USD to get the historical exchange rates.
Author: Alex Prengère
Home Page:
https://github.com/alexprengere/currencyconverterFork information:
A tax accountant told me, you need to pay taxes on the profit of your received forked coins as soon as you get them.
Therefore a "dummy" trade needs to be manually added to one of the csv export files in "trade_history_files".
* Add a "Buy" transaction at the moment you reveived the coins. (with price "0")
* Add a "Sell" transaction a few seconds later (price = initial price of forked coin) --> you made the inital profit.
* Add a "Buy" transaction a few seconds later than before (price = initial price) --> Because you know still got the coins
Simplifing this could be a feature in a future version...
Using the dummy-file:You can use this file to add trades from exchanges that do not provide trade history exports.
Important: You have to use the same formatting like the sample data in the file.
Ensure the right date formatting, and use "." for decimals.
Other Information: -For receiving the minute price data of bitcoin, the historical data of coinbase is used.
-For receiving the ETH price data, the poloniex API is used ( ~ 5min accuracy )
-For the USD/EUR exchange rate, the european central bank data is used.
-If you try to sell something you should not have it is displayed in the console.
-You can choose to continue or abort. If you sell a coin you received from a fork, this message will show up as you should not have that coin. Read "Fork information" for more info.
Disclaimer:I wrote this tool to calculate my taxes and thought I share it.
I do not guarantee that the results are 100% accurate, but the script might help you
getting a well formatted output csv you can work with.
If you run into any problems, don't hesitate to contact me at any time.
Donations: xrb_3mwnrhq1d4pdcrgegyygic1a1wpcbnsaj6pd5656dg3yxio3cyg1rn4u1umx