Skip to main content

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

August 2026
Last entry 2026-09-15 (2 months ago)
Period data
PeriodNet WorthIncomeExpensesNet Profit
2025-10-31227,099.48 USD5,844.45 USD219.46 USD5,624.99 USD
2025-11-30204,716.82 USD376.81 USD178.00 USD198.81 USD
2025-12-31197,662.08 USD1,869.44 USD3,917.85 USD-2,048.41 USD
2026-01-31194,880.73 USD360.57 USD252.25 USD108.32 USD
2026-02-28174,575.59 USD279.96 USD3,132.50 USD-2,852.54 USD
2026-03-31170,296.32 USD507.42 USD192.00 USD315.42 USD
2026-04-30180,176.46 USD1,423.82 USD214.21 USD1,209.61 USD
2026-05-31175,634.68 USD304.41 USD6,400.90 USD-6,096.49 USD
2026-06-30166,451.75 USD1,614.13 USD4,612.78 USD-2,998.65 USD
2026-07-31171,219.95 USD271.15 USD198.00 USD73.15 USD
2026-08-31183,534.96 USD3,477.07 USD204.91 USD3,272.16 USD
2026-09-30194,509.15 USD851.08 USD11.35 USD839.73 USD

Recent activity

EntryAccountAmountPostings
7,575.13 USD

Buy 0.10 BTC @ $75,637.79 · USD → BTC +1

+20.12 USD

stETH rebase reward — 0.008 stETH @ $2,514.42 · Staking → STETH

+830.96 USD

Receive 8 SOL ecosystem airdrop @ $103.87 · Airdrops → SOL

-200.50 USD

Mining electricity · Checking → Electricity

+310.78 USD

Mining reward — 0.004 BTC @ $77,695.01 · Mining → BTC

+12.09 USD

Staking reward — 0.005 ETH @ $2,418.09 · Staking → ETH

12,900.92 USD

Repay the margin loan · USD → Margin

Multiple postings

Close margin long — sell 0.20 BTC @ $80,275.58 · BTC → USD +1

README.md

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

bash
make install   # Install beancount + fava via uv
make check     # Verify the ledger has zero errors
make serve     # Open Fava at http://localhost:4739

File Guide

FileWhat it demonstrates
main.beanEntry point — options, plugins, and include directives
accounts.beanAll commodity definitions and account chart
prices/2024.beanMonthly price directives for BTC, ETH, SOL, ADA, and DeFi tokens
transactions/purchases.beanBuying crypto: simple buys, DCA strategy, stablecoins
transactions/trading.beanSales with short/long-term gains, crypto-to-crypto swaps, margin trading
transactions/staking.beanETH 2.0 staking, monthly rewards, Lido liquid staking (stETH)
transactions/mining.beanBTC mining rewards, electricity costs, equipment depreciation
transactions/defi-lending.beanCompound supply/yield, COMP rewards, Aave deposit/borrow/repay
transactions/defi-liquidity.beanUniswap LP provision, fee income, impermanent loss
transactions/transfers.beanExchange-to-wallet transfers, cross-chain bridging
transactions/airdrops.beanUNI and SOL airdrop income
transactions/nfts.beanNFT purchase with ETH, NFT sale with capital gain
transactions/tax-planning.beanTax 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

bash
make balances  # Show all account balances
make holdings  # Show holdings with market values
make income    # Show income statement
make check     # Verify ledger integrity