How a weighted average buy price is calculated

If you bought an asset more than once, your cost basis is the total you spent divided by the total quantity you now hold. That is a weighted average: each purchase influences the result in proportion to how much you actually put into it, not in proportion to how many times you clicked buy.

This is why averaging the prices themselves is wrong whenever the amounts differ. A large purchase at a low price and a small purchase at a high price are not equal contributors to your position, but a simple mean of the two prices treats them as though they were. The error runs in the direction that flatters you least — it typically reports a cost basis you never actually paid.

Fees belong inside the calculation. Trading fees, network fees and conversion charges are money spent to acquire the position, so they raise your true cost per unit. Leaving them out means every profit figure you compute afterwards is overstated by exactly the amount you were charged, and the distortion is worst on small or frequent purchases where a flat fee is large relative to the trade.

Average buy price = Total amount spent (including fees) / Total quantity acquired
Total amount spent
sum of (price x quantity) across every purchase, plus every fee paid on those purchases
Total quantity
the quantity actually credited to you, after any fee deducted in the asset itself

Worked example

Three purchases of the same asset at very different sizes and prices: 0.10 at 30,000 with a 15 fee, 0.25 at 24,000 with a 30 fee, and 0.05 at 44,000 with an 11 fee.

InputValue
Buy 10.10 at 30,000 (fee 15)
Buy 20.25 at 24,000 (fee 30)
Buy 30.05 at 44,000 (fee 11)
Total quantity0.40
Total spent including fees11,256
Weighted average buy price28,140
Simple mean of the three prices32,667

The simple mean says 32,667. The weighted average says 28,140 — the two differ by about 16%, because the largest purchase happened at the lowest price and the mean gives it no extra weight. Fees alone add 140 to the basis: excluding them the average would be 28,000, and every profit figure computed from it would be overstated.

How to use this calculator

  1. List every purchase separately with its quantity, its price and the fee paid on it.
  2. Use the quantity that was actually credited to your account — some exchanges deduct the fee in the asset, so you receive slightly less than you ordered.
  3. Include all acquisition fees: trading fees, network fees, and any conversion or deposit charge.
  4. Divide total spent by total quantity — never average the prices unless every purchase was exactly the same size.
  5. Recalculate after each new purchase, and keep the underlying records, since tax reporting usually requires the individual lots rather than the average.

Frequently asked questions

Why is averaging the prices wrong?
Because it weights every purchase equally regardless of size. Buying 0.25 units at 24,000 and 0.05 units at 44,000 puts five times more money into the cheaper buy, but a simple mean treats both as one data point each. The two methods only agree when all purchases are identical in size.
What is the difference between FIFO and weighted average?
FIFO treats the earliest units you bought as the first ones sold, so each disposal is matched to a specific purchase lot. Weighted average pools every purchase into one blended cost. They produce different gains on a partial sale, though over a complete exit the total is the same.
Which method should I use for tax?
Whichever your jurisdiction requires — this is not usually a free choice. Some tax authorities mandate FIFO, some permit weighted average, and some allow specific identification of lots. Confirm the current rule where you are resident, and keep lot-level records regardless, since you cannot reconstruct them later.
Does selling part of my position change the average?
Under the weighted-average method, no. Selling removes quantity at the existing average cost, so the cost per remaining unit is unchanged. Under FIFO it does change, because you have consumed your earliest lots and what remains was bought at different prices.
How do I handle an asset received rather than bought?
Airdrops, staking rewards and mined coins generally take a cost basis equal to their fair market value at the moment you received them. Record that value at the time — reconstructing a historical price for a specific timestamp months later is far harder than it sounds.
Should withdrawal and transfer fees count?
Fees to acquire the position belong in the cost basis. Fees to move an asset you already own between your own wallets are generally not acquisition costs, though treatment varies. Selling fees are normally deducted from proceeds instead, which produces the same effect on net profit.

Related calculators

This calculator is an educational tool. Results are estimates based on the inputs you provide and do not constitute financial advice. Verify figures with your bank, broker or a qualified advisor before acting on them.