DeCrypto Markets

Learn: plumbing

How is the cost basis of crypto calculated?

Cost basis is what the coins you sold cost you, including fees. Your gain is the proceeds after fees minus that cost. Methods differ: first in, first out takes the oldest purchases first, while average cost, used in Canada as the adjusted cost base, pools all identical units. Same trades, different gains. Check your jurisdiction.

How it works

When you sell part of a holding bought at different prices, you need to decide which purchases you sold. That decision sets the cost, and the cost sets the taxable gain or loss. Tax rules decide it for you, and they differ by country.

Under first in, first out (FIFO), the oldest units are sold first. If prices rose over time, the oldest units were the cheapest, so FIFO gives a larger gain on a sale. Under average cost, all identical units share one pool of cost, and each unit sold takes the average. In Canada, this pool is the adjusted cost base (ACB) for identical property. Other countries use FIFO, specific identification or their own pooling rules.

Fees count on both sides. Fees on a purchase are added to its cost, and fees on a sale come off the proceeds. Swapping one coin for another is usually a sale too in many jurisdictions, which surprises people who never cashed out to a bank. This page is not tax advice: rules differ by country and change over time.

The exact rule the games grade by

The rules the games use: amounts in cents and the smallest coin units, with a fill's value rounded half up to the cent. Buy fees are added to the cost; sell fees come off the proceeds. FIFO: the oldest lots are sold first, and a partial lot's cost is taken pro rata, rounded half up. Average cost (the Canadian ACB): one pool of cost for all units; a sale removes ACB x units sold / units held, rounded half up. Gain = proceeds after fees - cost. Not modelled: inclusion rates, the superficial loss rule and wash-sale rules.

Step by step

  1. List every buy and sell in order, with the quantity, the price and the fee.
  2. Add each buy's fee to its cost.
  3. For FIFO, take the cost of the oldest lots first, splitting a lot pro rata when you sell part of it.
  4. For average cost, keep one running pool: add every buy, and on each sale remove pool x units sold / units held.
  5. Proceeds = sale value minus the sell fee. Gain = proceeds minus the cost you removed.
  6. Keep the records. The method your jurisdiction requires decides which figure you report.

Worked example

The same sale under FIFO and average costSelling 1.5 coins for 89,910.00 after fees. FIFO counts a cost of 55,055.00 and a gain of 34,855.00; average cost (the Canadian ACB) counts 60,060.00 and 29,850.00.Sale proceeds 89,910.00: cost plus gainFIFOcost 55,055gain 34,855Average cost (ACB)cost 60,060gain 29,850Same trades, a 5,005.00 difference in the gain. Your jurisdiction decides the method.
One sale of 1.5 coins under two methods: the same proceeds split into cost and gain.

You buy 1 coin at 30,000 USDT with a 30 USDT fee, then 1 coin at 50,000 with a 50 fee. Later you sell 1.5 coins at 60,000 with a 90 fee. Proceeds after the fee: 89,910.00.

FIFO: the sale uses the whole first lot (30,030 with its fee) and half of the second (25,025). Cost 55,055.00, gain 34,855.00. The remaining half coin carries a cost of 25,025.00.

Average cost (the Canadian ACB): the pool is 80,080.00 for 2 coins, 40,040.00 per coin. Selling 1.5 coins removes 60,060.00. Gain 29,850.00. The remaining half coin carries 20,020.00.

Same trades, a 5,005.00 difference in the reported gain. The total gain over the whole life of the holding ends up the same; what changes is when it is counted.

Takeaway: FIFO reported 34,855.00 and average cost reported 29,850.00 on the same sale. The method is not a choice you make for convenience: your jurisdiction decides it.

Common mistakes

  • Forgetting fees. Buy fees raise your cost and sell fees lower your proceeds. Leaving them out overstates every gain.
  • Ignoring coin-to-coin swaps. In many countries, swapping one crypto asset for another is a disposal, with a gain or loss, even though no money reached a bank. Check how yours treats it.
  • Mixing methods. Using FIFO for one sale and average cost for the next, to pick the smaller gain, is not allowed where a method is required. Use the one your jurisdiction sets, consistently.
  • Losing the records. Exchanges close, change their exports or delete old history. Keep your own record of every buy, sell, swap and fee, with dates.

What this does not tell you, and what can go wrong

The games model only the arithmetic. They leave out the share of a gain that is taxable (Canada's inclusion rate, for example), the Canadian superficial loss rule that can deny a loss when you rebuy the same property around the sale, wash-sale rules elsewhere, transfers between your own wallets, staking and mining income, and whether you are treated as an investor or a business. Each of those can change what you owe.

Rules differ by country and change over time. This is a teaching model, not tax advice. Check your own jurisdiction with an official source or a qualified tax professional before filing.

Questions people ask

What is the adjusted cost base in Canada?

For identical property such as units of the same coin, the adjusted cost base is the total cost of all units you hold, including acquisition costs, averaged across them. Each sale removes its share of that pool. It is an average-cost method. This is a general description, not tax advice: confirm the details with the Canada Revenue Agency or a professional.

Is FIFO or average cost better?

Neither is better in general, and in many places you do not get to choose. When prices have risen, FIFO usually reports a larger gain on early sales and a smaller one later; average cost spreads it. Over the whole life of a holding, the total gain is the same. Your jurisdiction sets the method.

Do I pay tax when I swap one crypto for another?

In many jurisdictions, yes: a swap is treated as selling one asset and buying another, so it can create a gain or loss. Some places treat it differently. Check your own jurisdiction's official guidance, because this is where many people get caught out.

Practise it

Reading about a rule is not the same as applying it. These games generate a fresh simulation each round, ask you to make the call first, and grade you against the same rule.

Cost Basis

A ledger of buys and sells. Work out the cost and the gain under FIFO or average cost, with the Canadian ACB as the example.

What it teaches