Why trade-level cost matters
A total portfolio gain does not tell you the cost of a specific disposal. Each purchase adds a quantity of tokens and a fee-inclusive purchase cost. Each sale produces net proceeds after its selling fee. Realized P&L compares net proceeds with the part of historical purchase cost allocated to the quantity sold. This arithmetic is consistent even when price quotes fluctuate.
FIFO example
Imagine buying 2 tokens at USD 100 each with a USD 2 fee, then 3 tokens at USD 120 each with a USD 3 fee. The first lot has a total cost of USD 202, or USD 101 per token. If you later sell one token for USD 150 and pay USD 1 selling fee, FIFO gives USD 149 net proceeds, USD 101 cost basis, and USD 48 realized profit. The remaining four tokens retain their own underlying purchase costs.
Weighted-average example
With the same five tokens purchased for a total of USD 565, the weighted-average cost is USD 113 per token. The same one-token sale at net proceeds of USD 149 produces USD 36 realized profit under this arithmetic method. The cash proceeds did not change; the allocated basis did. For this illustration, FIFO and weighted-average results differ by USD 12 because of their different cost allocation conventions.
Data workflow and limits
Import rows in chronological order, with distinct transaction IDs, asset ticker, BUY/SELL, quantity, USD price and USD fee. Reject a sale larger than the recorded holdings rather than silently allowing a short sale. This calculator assumes one USD quote currency, long-only positions, no coin transfers, no fork/airdrop adjustments and no tax-lot elections. Which method is legally appropriate depends on jurisdiction and records, so the figures are not a filing recommendation.
Quick questions
Does a weighted-average result automatically qualify for tax filing?
No. This worksheet compares arithmetic inventory methods; applicable tax-lot rules depend on the jurisdiction and specific asset records.
Can one sale have different realized profit under different cost conventions?
Yes. The same net sale proceeds can be matched to different purchase-cost allocations, changing the computed realized gain.
Try the exact calculation
Open the corresponding free browser tool, enter the numbers from this explanation and verify the output. The example is fictional and has no predictive meaning.
Primary and original reference sources
Published: 2026-11-23 · General education; the scenarios described are not investment or tax advice. Verify changing technical and legal claims against the current primary sources.