TaxMyCrypto
A local, self-hosted crypto tax engine built around one question: can I trust the numbers before they land on Form 8949? It ingests exchange CSVs and on-chain history, reconciles prices and balances across independent sources, computes capital gains under FIFO / LIFO / HIFO, detects wash sales under IRC §1091, flags scam tokens, and exports IRS Form 8949, Schedule D, and an accountant-friendly summary as real PDFs. It runs on your laptop against a SQLite database, so wallet history never leaves the machine.
- Role
- Solo Engineer
- Period
- 2026
- Status
- Production
How the system fits together.
The calls that shaped it.
- 01
Prices are not taken from one source — they are reconciled across channels. The price service queries CoinGecko, CoinMarketCap and CryptoCompare in parallel, takes the median as the consensus, measures the max pairwise discrepancy, and only marks a price verified when at least two sources agree within 2%. When no public price exists it falls through a six-channel chain — CoinPaprika → Birdeye → DexScreener → on-chain swap parse → implied — and every source is persisted as its own row so a price can be audited later.
- 02
Balances are double-checked two independent ways. One ledger is recomputed from the raw transaction stream (inflows minus outflows minus gas); a second is summed from the tax-lot remaining amounts. The two are reconciled per wallet+asset down to 1e-8 and any drift is surfaced as a data-integrity issue — so the cost-basis math can never quietly disagree with what actually moved on-chain.
- 03
Cost-basis engine on decimal.js: FIFO / LIFO / HIFO lot matching plus full IRC §1091 wash-sale detection — losses inside a 30-day window are disallowed, the basis shifts to the replacement lot, each replacement share is used at most once — feeding a 13-check cross-validation gauntlet (genesis-aware timestamps, sold-≤-acquired, duplicate tx_hash, stablecoin off-peg, >20% swap-value mismatch, …) that grades issues critical / warning / info. Form 8949 (PDF + CSV) and Schedule D are filled against the real 2025 IRS PDF templates via pdf-lib.
- 04
Three-pass transfer matching keeps internal reshuffles off the disposal ledger: (1) same-chain tx_hash matching across wallets, (2) cross-chain bridge matching by wrapped↔native asset equivalence within 1% amount and a 2-hour window (with clock-skew tolerance), (3) hashless Coinbase-CSV ↔ on-chain matching within 5%. A matched transfer-in preserves the original cost basis instead of opening a phantom lot.
- 05
Two-stage on-chain scam defense. An algorithmic scorer weighs ten signals (unsolicited airdrop, zero value, hex/homoglyph names, batch arrivals, dust, no liquidity, never-interacted) into a recommended action; an investigator then goes on-chain — Blockscout for mass-airdrop transfer counts, contract verification, proxy detection, contract age, and deployer profiling (how many tokens that address has spawned → serial-scammer), and Solana RPC for mint/freeze authority and Token-2022 honeypot extensions. Flagged tokens are dropped from lot generation before the 8949 is computed.
- 06
SvelteKit 5 UI: drag-and-drop CSV import with blockchain auto-detect and live sync, a Review page that renders each validation issue as an actionable card (wallet, chain, explorer link, amounts), a Report page for export, and a wallet-graph fund-flow visualizer. 374 Vitest tests cover the cost-basis, wash-sale, reconciliation, and matching paths end to end.
The interesting work isn't the stack. It's the boundaries.
What it runs on.
- 01 SvelteKit 5 + TypeScript front-to-back; SQLite via better-sqlite3 + Drizzle ORM
- 02 Per-chain adapters: Ethereum / EVM scanner (Polygon, BSC, Arbitrum, Base), Solana (Helius + custom RPC), Bitcoin, Ripple, Cosmos
- 03 Price layer: CoinGecko + CoinMarketCap + CryptoCompare median consensus (verified ≤2% drift), with CoinPaprika / Birdeye / DexScreener / on-chain / implied fallback — each source cached as its own row
- 04 decimal.js cost-basis: FIFO / LIFO / HIFO lot matcher + IRC §1091 wash-sale engine
- 05 Two-ledger balance reconciliation (transaction stream vs tax-lot remaining) to 1e-8, plus a 13-check cross-validator
- 06 Three-pass transfer matcher (tx_hash · cross-chain bridge · hashless CSV) + on-chain scam investigator (Blockscout / Solana RPC)
- 07 pdf-lib filling the official 2025 IRS Form 8949 and Schedule D templates
- 08 374 Vitest tests gating the tax-math, reconciliation, and matching paths