amyandpotatoes / aus-crypto-tax-calc

Australian tax calculator for cryptocurrency transactions.
7 stars 1 forks source link

aus-crypto-tax-calc

This calculator processes and summarises cryptocurrency transactions to make it easier to lodge an Australian personal tax return. This is not tax advice, and you should carefully look through the the calculations to ensure that they are correct and meet current tax laws. This program uses the first-in-first-out (FIFO) method of calculating tax bases, and assumes that you are eligible for 50% capital gains tax discounts on tokens held for longer than a year.

Updates

08/08/2022: updated transactions.py to handle binance's new 2022 data export format and fixed bug in tax.py that incorrectly calculated overall cg when cg was net negative

Current status

Supported platforms

This program currently only supports the following Centralised Exchanges and blockchains:

If you'd like to help us cover more CEXs and chains, please add it in the issues tab!

Requirements

To use this program, you will need:

Preparation

Before you start the program you will need to:

  1. Create a file called api_keys.yml in the top level directory and add your API keys, an example format is shown below
    covalent: ckey_COVALENTKEYHERE
    bsc: BSCSCANKEYHERE
    polygon: POLYGONSCANKEYHERE
    ethereum: ETHERSCANKEYHERE
    fantom: FTMSCANKEYHERE
  2. Create a file called wallets.yml in the top level directory and add your wallet public addresses, you can name each entry whatever is helpful to you
    wallet1: '0x1234567812345678123456781234567812345678'
    wallet2: '0x1234567812345678123456781234567812345678'
  3. If you have any binance transactions or other earnings including staking or 'earn' income, extract a CSV transaction summary for the appropriate time frame from binance. For exports in the 2021 format, place these in the /transaction-files/binance-2021 folder. For exports in binance's current (2022) format, place the exports in the binance-2022-beth (for ETH staking), binance-2022-locked (for non-ETH locked staking) and binance-2022-trade (for buy/sells) folders respectively.

This programs supports transactions spread across multiple CSVs, so all CSVs in this folder will be read in sequence. Ensure your transaction history includes:

  1. If you have any CoinSpot or BTCMarket transactions, export CSVs of these transactions a place them in the /transaction-files/coinspot and /transaction-files/btcmarkets folders.

How to run

If you would like to use transactions from any of the following blockchains:

Then run the 'import_onchain_transaction.py' module.

Next, run the 'transactions.py' module to parse transactions and categorise them. Each time a transaction is parsed, progress is saved to a file which can be retrieved later.

Next, run the 'tax.py' module to produce a csv summary of transactions, capital gains and income.

Known issues

Support

If you would like to support this project, you can use this wallet address: 0x0BD679d61F2E25fa0BeC619661884Ecc1654b335 (preferred BSC or polygon)