Coinbean AI - a comprehensive AI cryptocurrency portfolio tracking system, the double-entry accounting system.
🌐 coinbean.org | linkedin.com/company/qai-lab | 🐦 x.com/qai_lab
English | 简体中文 | Français | 한국어 | 日本語 | Español
Created by Boyuan Qian @QAI Lab
Setup Scripts: Use ./setup.sh for macOS, ./setup_linux.sh for Linux, or setup_windows.ps1 for Windows.
Option 1: Docker (Recommended)
./setup.sh # Choose Docker installation
docker-compose up -d # Start FavaOption 2: Native Python
./setup.sh # Choose Python installation
./run.sh # Start Fava web interface
./prices.sh # Fetch current pricesOption 1: Docker (Recommended)
chmod +x setup_linux.sh
./setup_linux.sh # Choose Docker installation
docker-compose up -d # Start FavaOption 2: Native Python
chmod +x setup_linux.sh
./setup_linux.sh # Choose Python installation
./run.sh # Start Fava web interface
./prices.sh # Fetch current pricesOption 1: Docker (Recommended)
powershell -ExecutionPolicy Bypass -File setup_windows.ps1 # Choose Docker
docker-compose up -d # Start FavaOption 2: Native Python
powershell -ExecutionPolicy Bypass -File setup_windows.ps1 # Choose Python
# Then run Fava: fava crypto_main.beancountOpen http://localhost:5002 to view your portfolio.
Track your crypto portfolio across exchanges, wallets, DeFi, staking, and NFTs using double-entry accounting.
Supports:
- 10+ exchanges (Coinbase, Binance, Kraken, etc.)
- Hardware/software wallets (Ledger, MetaMask, Phantom)
- DeFi protocols (Aave, Uniswap, Lido, Hyperliquid)
- Staking & yield farming
- NFTs (Ethereum, Solana, Bitcoin Ordinals)
- 110+ cryptocurrencies
- ✅ Pre-configured accounts for exchanges, wallets, and DeFi
- ✅ 110+ cryptocurrency support with automatic price fetching
- ✅ NFT and Bitcoin Ordinals tracking
- ✅ Tax reporting with capital gains tracking
- ✅ Beautiful web interface (Fava)
- ✅ Docker support for easy deployment
coinbean/
├── crypto_main.beancount # Main ledger (110+ cryptos defined)
├── exchanges.beancount # Exchange accounts
├── chains.beancount # Wallets & staking
├── defi.beancount # DeFi protocols
├── crypto_prices.beancount # Price data
├── tx_2025.beancount # Your transactions
├── crypto_examples.beancount # 20+ example transactions
├── setup.sh # Setup script (macOS)
├── setup_linux.sh # Setup script (Linux)
├── setup_windows.ps1 # Setup script (Windows)
├── run.sh / prices.sh # Utility scripts
└── docker-compose.yml # Docker configuration
Edit these files:
tx_2025.beancount- Add your transactionsexchanges.beancount- Enable only exchanges you usechains.beancount- Add your walletsdefi.beancount- Add DeFi protocols you use
Assets:Crypto
├── Exchange:{Exchange}:{Asset} # Coinbase:BTC, Binance:ETH
├── Wallet:{Wallet}:{Asset} # Ledger:BTC, MetaMask:ETH
├── Staking:{Chain}:{Status} # ETH:Delegated, SOL:Rewards
├── DeFi:{Protocol}:{Asset} # Aave:USDC, Uniswap:LPTokens
└── NFT:{Chain}:{Collection} # Ethereum:BAYC, Solana:DeGods
Income:Crypto
├── Staking:Rewards
├── Trading:CapitalGains
└── Airdrops
Expenses:Crypto
├── Trading:Fees
├── Gas:{Chain} # Ethereum, Solana, etc.
└── Withdrawal:Fees
See crypto_examples.beancount for 20+ examples. Basic format:
2025-01-15 * "Coinbase" "Buy Bitcoin"
Assets:Crypto:Exchange:Coinbase:BTC 0.1 BTC {60000 USD}
Assets:Crypto:Exchange:Coinbase:Cash:USD -6000.00 USD
Expenses:Crypto:Trading:Fees 10.00 USD
Edit exchanges.beancount:
2020-01-01 open Assets:Crypto:Exchange:YourExchange:Cash:USD
2020-01-01 open Assets:Crypto:Exchange:YourExchange:BTC
2020-01-01 open Assets:Crypto:Exchange:YourExchange:ETH
Edit crypto_main.beancount:
2020-01-01 commodity YOUR
name: "Your Coin"
blockchain: "Ethereum"
category: "DeFi"
Then add to fetch_prices.py:
Asset('YOUR', 'Your Coin', 'Ethereum', 'DeFi', 'your-coin-id'),Comment out in crypto_main.beancount:
include "exchanges.beancount"
include "chains.beancount"
; include "defi.beancount" # Not using DeFi
| Command | Purpose |
|---|---|
./run.sh |
Start Fava (interactive menu) |
./prices.sh |
Fetch current crypto prices |
bean-check crypto_main.beancount |
Validate ledger |
bean-query crypto_main.beancount "SELECT..." |
Query data |
docker-compose up -d |
Start with Docker |
docker-compose logs -f |
View Docker logs |
Taxable events tracked automatically:
- Capital gains/losses (crypto sales, swaps)
- Staking rewards (as income)
- Airdrops (as income)
- DeFi yield (as income)
Generate reports:
# View all capital gains
bean-query crypto_main.beancount "
SELECT date, account, sum(position)
WHERE account ~ 'CapitalGains'
ORDER BY date"
# View staking income
bean-query crypto_main.beancount "
SELECT date, sum(position)
WHERE account ~ 'Staking:Rewards'"Use git-crypt to encrypt sensitive files:
brew install git-crypt
git-crypt init
echo "*.beancount filter=git-crypt diff=git-crypt" >> .gitattributes
echo "tx_*.beancount filter=git-crypt diff=git-crypt" >> .gitattributes| Issue | Solution |
|---|---|
bean-check errors |
Check account names, ensure transactions balance |
| Prices not showing | Run ./prices.sh, check crypto_prices.beancount |
| Balance mismatch | Review all transactions, check for missing fees |
| Fava won't start | Check if port 5002 is in use, try ./run.sh -p 5003 |
| Docker issues | Check logs with docker-compose logs |
- 📦 GitHub Repository
- 📋 Release Notes
- 🌐 Coinbean Website
- 💼 Connect on Linkedin
- 🐦 Follow on X/Twitter
- 📚 Beancount Docs
- 🖥️ Fava Documentation
Created by:
- Boyuan Qian - GitHub: @boyuanqian | Linkedin: @boyuan_qian
Organization:
MIT License - Copyright (c) 2025 Boyuan Qian and QAI Lab. See LICENSE file.
This tool is for personal portfolio tracking only. It does not provide financial, tax, or investment advice. Cryptocurrency investments carry risk. Consult qualified professionals for financial and tax matters.
Happy Tracking! 📊

