Pine Tree Tax
Crypto currencies experienced record-breaking growth in recent years. I decided to build my own software to help me in the preparation of my taxes.
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 other property. Gain or loss is also recognized every time a cryptocurrency is sold or used to purchase goods or services.
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.
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.
Paying for coffee with crypto currencies is a taxable event.
Have to report taxable income using the 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.
I decided to build Pine Tree Tax(PTT) in Rust). I want to learn Rust and I want to learn by doing. Rust is one of my favorite programming languages.
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:
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:
The main component of PTT is the Account class:
The transaction class gets populated with values from the transactions csv file using the Serde library:
A list of tax event structs gets serialized to .csv as output of the application:
The source code of PTT can be found at: Github