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.
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.
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.
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.
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.
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.
Add up quantity × price + fee for every buy, then divide by the total quantity bought. Sales do not change the average under average cost.
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.
Yes. A buy's fee is part of its cost and a sale's fee comes off its proceeds. Leaving them out overstates profit.
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.
© 2026 Perly. All rights reserved.