Crypto taxes are notoriously complex, and lot tracking is where most people mess up. Let me share what I’ve learned tracking Bitcoin and Ethereum in Beancount.
Cost Basis Methods
The IRS allows several methods for determining which coins you sold:
FIFO (First In, First Out): Sell oldest coins first
LIFO (Last In, First Out): Sell newest coins first
Specific Identification: Choose exactly which lot to sell
Why Lot Selection Matters
If you bought BTC at:
Jan 2024: 1 BTC at USD 40,000
Nov 2024: 1 BTC at USD 70,000
And sell 1 BTC at USD 65,000:
FIFO: Gain = USD 25,000 (sold the USD 40K coin)
Specific ID: Loss = USD 5,000 (sold the USD 70K coin)
That’s a USD 30,000 tax difference!
Beancount Implementation
; Purchases with lot tracking
2024-01-15 * "Buy BTC"
Assets:Crypto:BTC 1 BTC {40000.00 USD, 2024-01-15}
Assets:Bank:Checking -40,000.00 USD
2024-11-10 * "Buy BTC"
Assets:Crypto:BTC 1 BTC {70000.00 USD, 2024-11-10}
Assets:Bank:Checking -70,000.00 USD
; Sell with specific identification
2026-02-01 * "Sell BTC - specific lot"
Assets:Crypto:BTC -1 BTC {70000.00 USD, 2024-11-10} ; Specify exact lot
Assets:Bank:Checking 65,000.00 USD
Income:CapitalGains:Crypto:ShortTerm 5,000.00 USD
Questions
Anyone automate lot selection for tax optimization?
How do you handle exchange fees in cost basis?
What’s your approach for tracking across multiple exchanges?
Once you start using specific identification for a coin, the IRS expects consistency. Don’t switch between FIFO and specific ID arbitrarily—have a documented policy.
I personally use specific ID for everything because Beancount’s lot tracking makes it easy, and it gives me maximum tax flexibility.