Crypto Trader Example — beancount.io
A comprehensive Beancount ledger demonstrating every major cryptocurrency accounting scenario: purchases, trading, staking, mining, DeFi, NFTs, and tax planning. Ledger notes
Period data
| Period | Net Worth | Income | Expenses | Net Profit |
|---|---|---|---|---|
| 2026-08-31 | 183,534.96 USD | 3,477.07 USD | 204.91 USD | 3,272.16 USD |
Financial positionAug 30, 2026
Net Worth
183,534.96 USD183,534.96USD
Cost basis 193,565.49 USD · Unrealized -10,030.53 USD
Assets
183,534.96 USD- Assets:Bank:CheckingAssets:
Bank:Checking68,033.00 USD37.1% - Assets:Crypto:Coinbase:USDAssets:
Crypto: Coinbase:USD45,888.82 USD25% - Assets:Crypto:Wallet:MetaMask:ETHAssets:
Crypto: Wallet: MetaMask:ETH9,696.42 USD5.3% - Assets:Crypto:Binance:SOLAssets:
Crypto: Binance:SOL8,118.68 USD4.4% - Assets:Crypto:Wallet:Ledger:BTCAssets:
Crypto: Wallet: Ledger:BTC7,769.50 USD4.2%
15 more accounts
Liabilities
—Nothing owed
Money movementAugust 2026
Cash Flow
Loading account roles…
Recent activity
| Entry | Account | Amount | Postings |
|---|---|---|---|
-200.50 USD Mining electricity · Checking → Electricity | Assets:Bank:CheckingExpenses:Crypto:Mining:Electricity | -200.50 USD | |
+310.78 USD Mining reward — 0.004 BTC @ $77,695.01 · Mining → BTC | Income:Crypto:MiningAssets:Crypto:Mining:BTC | +310.78 USD | |
+12.09 USD Staking reward — 0.005 ETH @ $2,418.09 · Staking → ETH | Income:Crypto:StakingAssets:Staking:Ethereum:ETH | +12.09 USD | |
12,900.92 USD Repay the margin loan · USD → Margin | Assets:Crypto:Binance:USDLiabilities:Crypto:Binance:Margin | 12,900.92 USD | |
Multiple postings Close margin long — sell 0.20 BTC @ $80,275.58 · BTC → USD +1 | Assets:Crypto:Binance:BTCAssets:Crypto:Binance:USD+1 | Multiple postings | |
12,900.92 USD Open 2x margin long — buy 0.20 BTC @ $64,504.60 · Margin → BTC | Liabilities:Crypto:Binance:MarginAssets:Crypto:Binance:BTC | 12,900.92 USD | |
4,410.81 USD Re-enter SOL after 35 days @ $73.44 · USD → SOL +1 | Assets:Crypto:Binance:USDAssets:Crypto:Binance:SOL+1 | 4,410.81 USD | |
Crypto Accounting Example — beancount.io
A comprehensive Beancount ledger demonstrating every major cryptocurrency accounting scenario: purchases, trading, staking, mining, DeFi, NFTs, and tax planning.
Companion blog post: Complete Guide to Cryptocurrency Accounting with Beancount
Quick Start
make install # Install beancount + fava via uv
make check # Verify the ledger has zero errors
make serve # Open Fava at http://localhost:4739File Guide
| File | What it demonstrates |
|---|---|
main.bean | Entry point — options, plugins, and include directives |
accounts.bean | All commodity definitions and account chart |
prices/2024.bean | Monthly price directives for BTC, ETH, SOL, ADA, and DeFi tokens |
transactions/purchases.bean | Buying crypto: simple buys, DCA strategy, stablecoins |
transactions/trading.bean | Sales with short/long-term gains, crypto-to-crypto swaps, margin trading |
transactions/staking.bean | ETH 2.0 staking, monthly rewards, Lido liquid staking (stETH) |
transactions/mining.bean | BTC mining rewards, electricity costs, equipment depreciation |
transactions/defi-lending.bean | Compound supply/yield, COMP rewards, Aave deposit/borrow/repay |
transactions/defi-liquidity.bean | Uniswap LP provision, fee income, impermanent loss |
transactions/transfers.bean | Exchange-to-wallet transfers, cross-chain bridging |
transactions/airdrops.bean | UNI and SOL airdrop income |
transactions/nfts.bean | NFT purchase with ETH, NFT sale with capital gain |
transactions/tax-planning.bean | Tax loss harvesting, wash sale awareness, year-end balance assertions |
Key Concepts Demonstrated
- Cost basis tracking — every purchase creates a lot with date and price
- FIFO & specific lot identification — choosing which lot to dispose of
- Taxable dispositions — selling for fiat, crypto-to-crypto swaps, spending crypto
- Ordinary income — mining rewards, staking rewards, airdrops (all at FMV)
- DeFi receipt tokens — cUSDC, aETH, stETH, LP tokens as accounting proxies
- Gas fees — tracked as expenses, deducted from proceeds where appropriate
- Balance assertions — year-end reconciliation checks
- Short-term vs long-term — separate income accounts for tax reporting
Useful Commands
make balances # Show all account balances
make holdings # Show holdings with market values
make income # Show income statement
make check # Verify ledger integrity