This is a little tool for helping with capital gain calculation for crypto currencies. It uses ledger-cli.org style account books and spits out a csv file like the following:
Short term Trades |
|
Shares | Symbol | Buy Date | Sell Date | Sell Price | Buy Price | Gain | Running Total Gain | Refs |
XXX | FOO | 2015-10-22 | 2015-10-22 | XXX | XXX | XXX | XXX | S: bittrex.dat:43 foo.dat:44 B: foo_adj.dat:7 |
XXX | FOO | 2015-10-22 | 2015-10-22 | XXX | XXX | XXX | XXX | S: foo_adj.dat:7 B: foo_adj.dat:7 |
XXX | BTC | 2015-09-27 | 2015-10-25 | XXX | XXX | XXX | XXX | S: poloniex_adj.dat:10 B: bittrex.dat:55 |
… |
Long term Trades |
|
Shares | Symbol | Buy Date | Sell Date | Sell Price | Buy Price | Gain | Running Total Gain | Refs |
XXX | BTC | 2013-09-01 | 2015-04-29 | XXX | XXX | XXX | XXX | S: electrum_wallet1.dat:7-17 B: btc-e.dat:39 |
XXX | BTC | 2013-09-01 | 2015-08-12 | XXX | XXX | XXX | XXX | S: electrum_wallet1.dat:24 kraken.dat:8-38 B: btc-e.dat:39 |
XXX | BTC | 2013-09-01 | 2015-08-19 | XXX | XXX | XXX | XXX | S: electrum_wallet1.dat:33 B: btc-e.dat:39 |
… |
|
Remaining balances: |
Shares | Symbol | Buy Date | Buy Price | Refs |
XXX | AUG | 2015-08-19 | XXX | electrum_wallet1.dat:33 |
XXX | TAU | 2015-08-21 | XXX | masterxchange.dat:1 |
XXX | TAU | 2015-08-31 | XXX | masterxchange.dat:6 |
… |
The "Refs" column pointa to the file number, line number(s) of the individual ledger posting used, so it's easy to track what this program does. Each line shows the "S", sale, and "B", buy of the coin, and intra-day entries are combined. For example, on line 1, bittrex.dat:43 means the bittrex.dat ledger file, line 43, and an example ledger entry might be:
2015-10-22 12:45:01 * Trade
Assets:bittrex XXX BTC
Assets:bittrex -XXX FOO
WARNING: I just added a large portion to this for ledger and multi crypto currency support and am the only user as far as I know, so there may be bugs lurking. This is GNU licensed.
You can get it here:
https://github.com/redfish64/bitcoin-tax-calculator