This tool reads a CoinMarketCap transactions CSV and calculates FIFO cost basis, capital gain/loss, and holding days.
- Parses portfolio transaction CSV exports.
- Matches sells to prior buys using FIFO lots.
- Calculates:
cost to buytotal sold forcapital gain/lossdays held
- Writes a
report.csvfile you can use in spreadsheets.
npm installnpm start -- <path-to-transactions.csv> [output-report-path]Examples:
npm start -- /Users/you/Desktop/Main_for_all/Main_transactions.csv
npm start -- /Users/you/Desktop/Main_for_all/Main_transactions.csv /Users/you/Desktop/report.csvIf output-report-path is not provided, output defaults to ./report.csv.
- The app validates that every sell can be matched to prior buys. If a sell exceeds available inventory, it throws an explicit error instead of silently dropping unmatched amounts.
- Some exports can include rounding drift. If this happens, inspect the flagged transaction in your source CSV and adjust data before rerunning.
npm testnpm run lint
npm run format:check