Self-hosted crypto tax reporting from the command line

Sync Coinbase by API or CSV, import major exchange exports, and pull EVM wallet history into one private tax ledger. Built for repeatable local accounting from raw events to tax forms.

npm install -g @gfargo/daybook

Everything you need for crypto tax reporting

From ingestion to export, daybook handles the full pipeline in a single CLI tool.

Multi-Source Ingestion

Sync Coinbase by API or CSV, import Coinbase, Kraken, Binance, Binance.US, Crypto.com, Gemini, Robinhood, and generic CSV exports, plus EVM wallet history.

Event Classification

An 8-rule chain classifies raw events into trades, transfers, income, NFT acquisitions/disposals, and more. Manual overrides are first-class.

Cost Basis Computation

Compute gains and losses with FIFO, HIFO, LIFO, or Specific ID lot selection. Compare methods side-by-side before exporting.

Wash Sale Flagging

Automatically flags loss disposals with acquisitions within ±30 days. Informational only — you stay in control.

Multi-Format Tax Export

Export as CSV, IRS Form 8949 PDF, Schedule D PDF, or TXF for TurboTax. NFT disposals included alongside fungible tokens.

Incremental Sync

Use --from for Coinbase API and EVM wallets to sync from a date or block number. No need to re-import your full history.

NFT Cost Basis

Track ERC-721 and single-copy ERC-1155 collectibles as individual lots. Purchases, mints, airdrops, sales, and NFT-for-NFT trades are handled.

Sources & methods

Start with Coinbase API sync, supported exchange CSV profiles, universal imports, and EVM wallet history today. Planned coverage focuses on more large exchanges and non-EVM chains.

Data Sources

SourceMethodSince
CoinbaseAPI sync + CSV importsupported
KrakenCSV importsupported
BinanceLedger CSVsupported
Binance.USTax-report CSVsupported
Crypto.comApp / Exchange / DeFi CSVsupported
GeminiExchange CSV profilesupported
RobinhoodCrypto CSV profilesupported
Generic CSVUniversal ledger importsupported
EthereumAlchemy APIsupported
PolygonAlchemy APIsupported
BaseAlchemy APIsupported
ArbitrumAlchemy APIsupported
OptimismAlchemy APIsupported
BNB ChainAlchemy APIsupported
EtherscanFailed-tx gassupported

Planned Coverage

SourceMethodStatus
OKX / BybitCSV profilesplanned
Solana / BitcoinChain adaptersplanned
More CEX APIsRead-only syncplanned

Cost Basis Methods

FIFOv1

First in, first out — the IRS default method.

HIFOv1

Highest cost, first out — minimizes taxable gains by disposing of the most expensive lots first.

LIFOv1.2

Last in, first out — disposes of the most recently acquired lots first.

Specific IDv1.1

Hand-pick which lots to dispose of with an interactive picker or JSON replay file.

Up and running in minutes

A short local workflow from install to tax-ready output.

1Install
$ npm install -g @gfargo/daybook
2Initialize
$ daybook init
3Add Coinbase
$ daybook account add main-coinbase --source coinbase
4Set API key
$ export COINBASE_CDP_KEY_NAME=...
5Sync transactions
$ daybook sync --source coinbase --from 2024-01-01
6Classify events
$ daybook classify
7Export tax report
$ daybook export 2024 --format 8949

Clean, modular architecture

Five packages with one-directional dependencies. No cycles, no spaghetti.

Packages

@daybook/ledger

Core data model, types, SQLite storage

@daybook/sourcesledger

Coinbase API/CSV, exchange CSV profiles, generic CSV, EVM adapters

@daybook/classifierledger

8-rule event classification chain

@daybook/taxledger

Cost basis, NFT lot tracking, pricing, wash sale, multi-format export

@daybook/clitax, classifier, sources, ledger

Commander + Ink terminal UI

Data Flow

1
sync
2
raw events
3
classify
4
ledger entries
5
export
6
CSV
cli → tax → classifier → ledger
sources → ledger