Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChainLedger

Multi-chain crypto tax export for Cosmos, EVM, and Solana — plus portfolio tracking across your wallets.

Pull transactions from explorers and RPCs, normalize them into one CSV, filter spam and airdrops, label swaps and counterparties, and review everything in a searchable HTML report. Built for Indian FY periods (IST) but works for any date range.

Cosmos metadata comes from the chain registry. USD pricing uses CoinGecko.

Tax export workflow

git clone https://github.com/vitwit/chainledger.git
cd chainledger
cp configs/config_example.json configs/config.json
# edit configs/config.json — add your addresses and API keys
make build

make export-txs       # fetch Cosmos + EVM + Solana txs for FY 2025-26
make filter-tax       # clean, label, and generate reports
open exports/FY2025-26/tax_report.html

One-liner to rebuild from existing on-disk exports (no re-fetch):

make rebuild-tax && make filter-tax

What you get

After make filter-tax, exports/FY2025-26/ contains:

File Purpose
tax_report.csv Raw merged report from all chains
tax_report_filtered.csv Clean report for filing / Google Sheets
tax_report_excluded.csv Spam, dust, and airdrops with exclusion reason
tax_report.html Searchable viewer — filter by network & notes, click through to explorers
swap_report.html Paired DeFi swap legs grouped by transaction
swap_groups.json Swap groups for programmatic import
tax_summary_filtered.txt Row counts and breakdown by network / note
manifest.json Export metadata and per-address tx counts
verify_report.txt Consistency check (run via make verify-export)

Per-chain raw data lives under cosmos/, evm/, and solana/.

Tax filter features

The filter pipeline (make filter-tax) enriches and cleans your export:

  • Spam & scam removal — unknown tokens, dust, unsolicited airdrops
  • Human-readable amounts — normalized values and token symbols (including IBC denoms)
  • DeFi swap pairing — tags related in/out legs with swap_group_id and swap_tag
  • Internal transfers — both from and to are your wallets → internal-transfer
  • Counterparty labels — e.g. exchange deposits (from-ascendex), bank transfers (to-bank); configurable in config.json
  • Cosmos memo parsing — governance votes, IBC transfers, and other message types
  • Explorer links — Etherscan, Polygonscan, Arbiscan, Mintscan, Solscan

Make targets

make export-txs          # all chains (FY 2025-26)
make export-cosmos       # Cosmos only (merges existing EVM/Solana data)
make export-solana       # Solana only (Helius recommended)
make export-arbitrum     # Arbitrum EVM only
make filter-tax          # filter + HTML reports
make rebuild-tax         # rebuild tax_report.csv from disk (no API calls)
make verify-export       # validate manifest vs on-disk counts

Custom period:

./bin/txexport -period FY2025-26 -out exports/FY2025-26
./bin/txexport -from 2025-04-01 -to 2026-03-31 -out exports/custom
./bin/txexport -cosmos-only -out exports/FY2025-26
./bin/txexport -solana-only -out exports/FY2025-26
./bin/txexport -evm-only -evm-network arbitrum -out exports/FY2025-26

Data sources: Cosmos via Mintscan (LCD fallback); EVM via Etherscan (Moralis fallback for Base/BSC); Solana via JSON-RPC or Helius (helius_api_key + helius_rps in config).

Dump all derived Cosmos addresses:

go build -o bin/dumpcosmos ./cmd/dumpcosmos
./bin/dumpcosmos -out exports/cosmos_addresses.txt

Configuration

Edit configs/config.json:

Key Purpose
cosmos_networks Chain-registry folder names (cosmoshub, osmosis, …)
cosmos_addresses Bech32 seeds — derived per chain automatically
evm_networks / evm_addresses RPC URLs and wallet addresses (Ethereum, Polygon, Arbitrum, …)
solana_networks / solana_addresses RPC and Solana addresses
counterparties Label known addresses (e.g. bank, exchange hot wallets)
exchanges Exchange API config (e.g. Ascendex deposit address lookup)
fixed_balances Manual off-chain holdings
mintscan_api_key Cosmos transaction export (Mintscan API)
etherscan_api_key EVM transaction export (Etherscan API)
moralis_api_key EVM token metadata + Base/BSC tx export fallback
helius_api_key Helius RPC for reliable Solana tx export
helius_rps Helius rate limit (default 10)
coingecko_uri CoinGecko markets URL for USD prices
export_dir Default output directory for tx exports

See configs/config_example.json for a full example.

Portfolio

Live balance snapshot across configured networks — Cosmos (bank, staking, rewards), EVM native + ERC-20, and Solana (native SOL + priced SPL tokens):

make run
# or
./bin/chainledger

Solana uses helius_api_key when set (recommended); otherwise falls back to solana_networks[].rpc. Only SPL tokens with known mint metadata and a CoinGecko price are included.

Shows bank, staking, and reward balances with USD totals. Unknown IBC denoms and unpriced spam tokens are skipped.

Development

make test       # run tests
make lint       # golangci-lint
make clean      # remove binaries
make gen-ibc-index  # regenerate IBC denom index (optional: CHAINLEDGER_ASSETLISTS_ROOT)

Requires Go 1.21+.

About

Multi-chain crypto tax export for Cosmos, EVM, Solana. CSV + HTML reports with swap pairing and spam filtering.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages