Tracking a Crypto Portfolio: Average Cost and Profit and Loss
How to track crypto across exchanges and wallets, how average cost basis and realised and unrealised profit work, and why tax methods differ by country.
Tracking a Crypto Portfolio: Average Cost and Profit and Loss
Crypto investors often end up with coins spread across several exchanges and wallets, bought at many different prices. Without good records, it is hard to know what you have, what it cost and whether you are up or down. The Crypto Portfolio Tracker works offline, without connecting accounts or sharing API keys.
Recording transactions
Each transaction needs:
- the date,
- the type: buy, sell, transfer in, transfer out, staking reward or fee,
- the coin,
- the quantity,
- the price per unit in your currency,
- any fee,
- the exchange or wallet.
Most exchanges let you download your history as CSV. Rename the columns to match the form labels and import it.
Average cost basis
With the average-cost method, the cost of all coins of one type is pooled:
- Every buy adds the quantity and adds the amount paid, including fees, to the cost basis.
- The average cost per coin is the cost basis divided by the quantity held.
- When you sell, the realised profit or loss is the sale price minus the average cost, multiplied by the quantity sold, minus any fee.
- After a sale, the average cost stays the same; only the quantity and cost basis fall.
Transfers between your own wallets are recorded as a transfer out and a transfer in, which move coins without creating a gain.
Realised and unrealised
- Realised profit or loss is locked in when you sell.
- Unrealised profit or loss is the difference between the current value of what you still hold and its cost basis.
Enter current prices in Settings, one coin per line, to see current value and unrealised profit.
Staking and rewards
Staking rewards add coins at the price when you received them. In many countries this counts as income at that value, and the value becomes the cost basis of those coins. The tracker shows staking income separately.
Tax methods differ
Tax offices use different methods:
- The IRS in the United States allows first-in-first-out or specific identification.
- HMRC in the United Kingdom uses share pooling with special same-day and 30-day rules.
- Some countries use average cost; others use FIFO.
The tracker's average-cost figures give a clear portfolio view, but your tax return must follow your country's rules. Keep exchange statements and wallet records; tax offices can ask for them.
Allocation
With prices entered, the tracker shows your allocation by coin, helping you see whether one asset dominates your portfolio.
A worked example
An investor buys 0.05 BTC at $42,000 with a $10 fee and 0.03 BTC at $52,000 with an $8 fee. The cost basis is $3,678 for 0.08 BTC, an average cost of about $45,975. Selling 0.02 BTC at $64,000 with a $6 fee realises about $355 profit, leaving 0.06 BTC with a cost basis of about $2,759.
Good record habits
- Export your exchange history every few months. Exchanges close, merge or delete old data, and then the records are gone.
- Note wallet addresses in the notes field so you can trace transfers later.
- Record coin-to-coin swaps as two transactions: a sell of one coin and a buy of the other, both at the value on that date. Many tax systems treat a swap as a disposal.
- Record network fees on transfers as a fee entry. They reduce your holdings even though nothing was sold.
- Back up the JSON file somewhere outside your browser, because clearing site data would delete the log.
These habits make reconciliation simple when your tax return is due.
Limits
This is a portfolio record, not tax or investment advice. Crypto is volatile and you can lose money. Data stays in your browser.



