Pine Tree Tax is a crypto currency capital gains calculator implemented in Rust.
Cryptocurrencies according to the IRS
The IRS addressed the taxation of cryptocurrency transactions in Notice 2014-21. According to that notice crypto currencies are treated as property for tax purposes and taxpayers must recognize gain or loss on the exchange of cryptocurrency for cash or for other property. Gain or loss is also recognized every time a cryptocurrency is sold or used to purchase goods or services.
Types of transactions:
Settled for cash
A taxpayer who sells a crypto currency position for cash must report a capital gain on Form 8949. A position held for one year or less is considered a short-term capital gain taxed at ordinary tax rates. A position held for more than one year is considered a long-term capital gain.
As with stock trades, capital losses offset capital gains in full, and a net capital loss is limited to $3,000 ($1,500 for married taxpayers filing separately) against other types of income on an individual tax return. An excess capital loss is carried forward to the subsequent tax year.
Under IRS rules, the default for stock transactions is the first-in, first-out (FIFO) method of accounting.
Exchanged for other cryptocurrencies.
Crypto-to-crypto trades generate tax liability.
When a taxpayer mines a cryptocurrency, the fair market value of the coins mined should be included in gross income. The amount of the income equals the market price of the coins on the day they were awarded on the blockchain.
Payment for goods and services.
Paying for coffee with crypto currencies is a taxable event.
Chain forks and airdrops.
Have to report taxable income using market value on the day of the split or airdrop.
Cryptocurrency can be donated directly to a charity. The tax deduction will be equal to the fair market value of the donated coins, and the donor will not pay tax on the gain.
Pine Tree Tax
PTT uses the FIFO (first in, first out) method of accounting. It considers every transaction between two different cryptocurrencies as a taxable event. It tracks the cost basis from the price of the original purchase and transferrs that cost basis from the original token to the new token.
Capital gains or losses events are triggered when a cryptocurrency is sold for USD or when a quantity is transferred to an account not owned by me.
PTT is a command line application that reads the crypto currency transactions from an input .csv file. Example transaction file:
| id | datetime | origin_wallet | origin_asset | origin_quantity | destination_wallet | destination_asset | destination_quantity | usd_value | usd_fee | |----+--------------------------+---------------+--------------+-----------------+--------------------+-------------------+----------------------+-----------+---------+ | 1 | 2016-05-10T13:01:00.000Z | External | BTC | 0.18312594 | Coinbase | BTC | 0.18312594 | 83.23 | | | 2 | 2016-05-12T20:59:00.000Z | Coinbase | BTC | 0.01000000 | External | BTC | 0.01000000 | 4.56 | | | 3 | 2016-05-12T23:12:00.000Z | Coinbase | BTC | 0.08788000 | External | BTC | 0.08788000 | 40.00 | | | 4 | 2016-06-02T08:09:00.000Z | Bank | USD | 2475.25000000 | Coinbase | BTC | 4.61456003 | 2475.25 | 24.75 | | 5 | 2016-06-05T18:57:00.000Z | External | BTC | 0.04112000 | Coinbase | BTC | 0.04112000 | 23.72 | | | 6 | 2016-06-05T19:50:00.000Z | Coinbase | BTC | 0.02000000 | External | BTC | 0.02000000 | 11.51 | | | 7 | 2016-06-07T15:37:00.000Z | External | BTC | 0.07062000 | Coinbase | BTC | 0.07062000 | 40.77 | | | 8 | 2016-06-14T12:23:36.000Z | Gdax | BTC | 1.49551345 | Gdax | ETH | 55.22575516 | 1033.61 | 3.10 |
The value in the field "usd_value" represents the market value of the transaction at the time the exchange took place.
The application generates 2 output files in .csv format (long and short term capitail gains). Example output file:
Process a transaction file and generate long and short term capital gains reports in .csv format:
cargo run -- <INPUT_FILE_NAME>
Convert from Kraken transaction format to Pinte Tree Tax format:
cargo run -- trades.csv -c kraken
Convert from Bittrex transaction format to Pinte Tree Tax format:
cargo run -- BittrexOrderHistory_2017.csv -c bittrex
- Fork it
- Download your fork to your PC (
git clone https://github.com/your_username/pine-tree-tax && cd pine-tree-tax)
- Create your feature branch (
git checkout -b my-new-feature)
- Make changes and add them (
git add .)
- Commit your changes (
git commit -m 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new pull request
PTT is based on cryptogains