/crypto-gains
Calculate capital gains with IRS-compliant rules.
Steps
-
Load lots from normalized/cost-basis.json and transactions from normalized/transactions.json .
-
Build sell list and allocate FIFO lots per asset.
-
Classify each gain as short-term or long-term by holding period.
-
Detect wash sales within 30 days for securities. Mark crypto as not applicable per current policy.
-
Write gains to normalized/capital-gains.json and updated lots to normalized/cost-basis-updated.json .
-
Generate Form 8949 outputs and summaries.
Examples
Build FIFO gains and updated lots
pnpm gains
Generate Form 8949 and tax summaries
pnpm report
References
-
normalized/transactions.json
-
normalized/cost-basis.json
-
normalized/capital-gains.json
-
normalized/cost-basis-updated.json
-
reports/tax-ready/form-8949-c.csv
-
reports/tax-ready/turbotax-import.csv
-
reports/tax-ready/schedule-d-summary.md
-
scripts/calculate-gains.ts
-
scripts/generate-report.ts