Calculate crypto capital gains (FIFO) per SA tax year
crypto_gains_fifoCalculates South African capital gains and losses on crypto from a list of buys, sells, crypto-to-crypto swaps, spends, gifts and crypto income, using first-in-first-out (SARS accepts FIFO or specific identification; weighted average is not allowed). Returns each disposal's proceeds, base cost and gain, totals per tax year (1 March – end February), income to declare, and holdings left with their base cost. Optionally estimates the tax per year.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| treatment | No | capital (investor) or revenue (trader: gains taxed in full as income). Use crypto_capital_or_revenue if unsure | capital |
| estimate_tax | No | Optional: also estimate the tax per tax year | |
| transactions | Yes | Every acquisition and disposal, any order (sorted by date; same-day keeps the given order). Include all earlier purchases of an asset, or the gain is overstated. |