← Back to perly.io
Perly

How to calculate crypto profit and your average buy price

Published 10 November 2026

To calculate crypto profit, start from your average buy price: everything you paid for a coin, fees included, divided by how many you bought. Unrealized profit is the current price minus that average, times what you still hold. Realized profit is what a sale brought in, after its fee, minus the average cost of the coins you sold. Add the two and you have your total profit.

1. Average buy price

Add up the cost of every buy — quantity times price, plus the fee — and divide by the total quantity bought. A toy example with round numbers: you buy 2 coins at 100 with a fee of 2, then 2 coins at 200 with a fee of 2. You paid 202 + 402 = 604 for 4 coins, so your average buy price is 151. Without the fees it would be 150; small fees on many buys add up.

2. Unrealized profit

Unrealized profit is what you would make if you sold everything now, before the sale's own fee: (current price − average buy price) × quantity held. If the price is now 180, your 4 coins are worth 720 and cost 604, so you are up 116 on paper. It changes every time the price does, and it is only a reading until you sell.

3. Realized profit

When you sell, profit becomes realized. Under average cost, the coins you sell carry your average buy price: realized profit = (sale price × quantity − sale fee) − (average buy price × quantity). Sell 1 coin at 180 with a fee of 1: you receive 179, those coins cost 151, so you realized 28. The 3 coins left still carry an average of 151, because selling does not move the average.

That is average cost. The other common method, FIFO, treats the coins you sell as the oldest you bought, at their price, which shifts profit between realized and unrealized without changing the total. The difference, with the same kind of toy example, is in average cost vs FIFO.

4. Return on investment (ROI)

ROI puts profit against what you put in: ROI = (current value of holdings + money taken out by sales − total cost) ÷ total cost. In the example: holdings worth 3 × 180 = 540, plus 179 from the sale, minus 604 paid, is 115 of profit on 604, or about 19%. It answers "how well has this done" in one number, regardless of how much you invested.

Mistakes that skew the numbers

  • Leaving out fees. Trading fees and withdrawal fees are real costs. Left out, your average looks lower and your profit higher than it is.
  • Counting a transfer as a sale. Moving coins between your own wallets realizes nothing.
  • Missing history. A coin deposited from another exchange with no buy recorded has no cost, so the whole of its value shows as profit.
  • Coin-to-coin trades. Swapping one coin for another is a sale of the first and a buy of the second, each at its value at the time.
  • Mixing currencies. If you buy in euros and in bitcoin, record each in what you paid with, and let the tracker convert.

Profit is not the same as tax

The arithmetic above tells you how an investment has done. What you owe in tax is a separate question with rules that differ by country: some require FIFO, some allow average cost, some let you pick which coins you sold. Nothing here is tax advice; ask someone who knows the rules where you live.

Where Perly fits

Short answers

How do I calculate my average buy price in crypto?

Add up quantity × price + fee for every buy, then divide by the total quantity bought. Sales do not change the average under average cost.

What is the difference between realized and unrealized profit?

Unrealized profit is on paper: what your holdings would make at today's price. Realized profit is what sales actually brought in, after fees, minus what the sold coins cost.

Do fees count in crypto profit?

Yes. A buy's fee is part of its cost and a sale's fee comes off its proceeds. Leaving them out overstates profit.

How do I calculate crypto ROI?

Current value of what you hold, plus what sales brought in, minus the total you paid, all divided by the total you paid.

This guide explains how things work. It is not financial, investment or tax advice. Something wrong? Write to hi@perly.io and we will correct it.

← Back to perly.io

© 2026 Perly. All rights reserved.