· 5 min read
How to Track Crypto Cost Basis and Realized Gains
Heshan Fernando
Co-founder & COO
You’ve made several buys and sells of the same crypto asset over time, at different prices, and now you need to know your actual cost basis and realized gain or loss — whether for your own tracking, or because you need the numbers for tax reporting. Unlike a single buy-then-sell transaction, tracking cost basis across multiple purchases at different prices means the “cost” of any given sale isn’t simply obvious — it depends on which accounting method you’re using and how prior purchases have been layered in.
Manually recalculating average cost basis after every new trade, especially across a longer trading history, is exactly the kind of running calculation that’s easy to get wrong by hand, and getting it wrong has real consequences if the numbers feed into a tax filing.
What tracking crypto cost basis actually involves
Average cost basis tracking means maintaining a running weighted average of what you’ve paid for your current holdings, updating it with every new buy, and calculating realized gain or loss — the difference between sale price and your average cost basis — every time you sell some or all of a position. Total position size also needs to be tracked alongside cost basis, since a sale reduces both your holdings and the portion of your total cost basis attributed to what remains.
Why people get stuck here
- Manually recalculating average cost after every trade. Doing this by hand across a meaningful trading history is tedious and genuinely error-prone, especially with several purchases at different prices layered over time.
- Confusing average cost basis with other accounting methods. FIFO (first-in-first-out), LIFO, and average cost each calculate realized gains differently for the same set of trades, and mixing up which method you’re actually supposed to use produces the wrong number for tax purposes.
- Losing track of position size alongside cost basis. A sale doesn’t just realize a gain or loss — it also reduces your position size and the total cost basis remaining, and both need to stay consistent with every subsequent trade.
- Not logging trades consistently as they happen. Reconstructing a full trade history after the fact, especially across multiple exchanges or wallets, is much harder and more error-prone than logging each trade as it occurs.
What a good crypto cost basis tracker looks like
Maintains a running average cost basis automatically
Recalculating the weighted average cost basis with each new buy removes the manual arithmetic that’s easy to get wrong across a longer trade history.
Calculates realized gain or loss on every sale
Computing the actual gain or loss at the moment of each sale, based on the current average cost basis, gives you the number that actually matters for tracking performance or tax purposes.
Tracks total position size alongside cost basis
Keeping position size and cost basis updated together ensures the running numbers stay internally consistent as trades accumulate over time.
Common mistakes to avoid
- Manually recalculating cost basis by hand across a long trade history, risking a compounding arithmetic error.
- Mixing accounting methods (average cost, FIFO, LIFO) inconsistently across your own tracking, which produces numbers that don’t match any single defensible method.
- Forgetting to log every trade, including smaller ones, which throws off the running average and position size over time.
- Treating a personal tracking tool’s output as final tax guidance without confirming the accounting method matches what’s actually required or elected for your tax situation.
- Losing trade records across multiple exchanges or wallets instead of consolidating them into one running log.
How to do it with Crypto Cost Basis Tracker
Online Tool Store’s Crypto Cost Basis Tracker tracks your trades entirely in your browser.
- Open the Crypto Cost Basis Tracker tool.
- Log each buy and sell trade for the asset you’re tracking, with price and quantity.
- Review the running average cost basis, realized gain/loss per sale, and total position size.
- Use the tracked numbers as a personal reference — confirm the actual accounting method required for any tax filing with a tax professional.
Frequently asked questions
What’s the difference between average cost, FIFO, and LIFO?
Average cost calculates a single running weighted average cost across all your holdings. FIFO (first-in-first-out) treats the earliest purchased units as the ones sold first. LIFO (last-in-first-out) treats the most recently purchased units as sold first. Each produces different realized gain/loss figures for the same set of trades, and which one applies can depend on your jurisdiction and tax elections.
Is average cost basis always the right method to use for taxes?
Not necessarily — the correct method depends on your specific tax jurisdiction’s rules and any elections you’ve made, and this can vary meaningfully by country. This tool tracks average cost basis as a personal reference; confirm the actual required method with a tax professional before relying on it for a filing.
Why does position size matter alongside cost basis?
A sale reduces both your remaining position size and the total cost basis attributed to what’s left — tracking both together, rather than cost basis alone, keeps the running numbers internally consistent as more trades happen over time.
Final thought
Manually tracking cost basis across a real trading history is exactly the kind of running calculation where small errors compound — log every trade as it happens, and let the running average update itself instead of reconstructing it by hand later.