Crypto Stats
Back to home
  1. Home
  2. /
  3. Guides
  4. /
  5. How crypto P&L is calculated
Guide

How crypto P&L is calculated

Realized versus unrealized, weighted-average cost basis, what counts as a disposal — and why two trackers report different profit on the same wallet.

Updated August 26, 2026

Two portfolio trackers can look at the same wallet and report different profit. Neither is lying — they are using different definitions. Here is the arithmetic, and where the disagreements come from.

Realized and unrealized are two different numbers

Realized P&L is profit you have locked in: it exists only when you dispose of an asset. Sell 1 ETH for USDT and the difference between what you received and what that ETH cost you is realized, permanently, whatever the price does afterwards.

Unrealized P&L is the profit your open position would make if you closed it right now. It is the live price of what you hold, minus what you paid for it. It moves every minute and it is not money until you sell.

Adding them gives total P&L. Reporting only one of them is the single most common reason a tracker's number surprises you.

Cost basis: weighted average, not FIFO

To know what something cost you, you need a cost basis. If you bought once, it is the purchase price. If you bought seven times at seven prices, it is a choice of method — and the choice changes the answer.

  • Weighted average cost — every buy is folded into one running average price for the whole position. Crypto Stats uses this, and so do most trackers.
  • FIFO — the coins you sell are assumed to be the ones you bought first. Common in tax reporting, and it produces a different realized number from the same trades.

Neither is more correct in the abstract; what matters is that one method is applied to every trade. A tracker that mixes methods will not reconcile with itself.

What counts as a disposal

Realized P&L is only produced by a trade — a buy, a sell, or a swap. This is where naive tracking goes wrong: moving coins is not trading them.

  • Buy, sell, swap — a disposal. A swap is two legs at once: you dispose of one asset and acquire another, so it realizes P&L on the leg you gave up.
  • Send and receive — not a disposal. Moving 1 BTC from an exchange to your own wallet changes where the coin is, not what it cost you. Counting it as a sale invents profit that never happened, and it is a very common source of nonsense numbers.

A worked example

Three buys and one sell, weighted-average cost basis:

  • Buy 1 SOL at $80 → position 1 SOL, average cost $80
  • Buy 2 SOL at $110 → position 3 SOL, average cost (80 + 220) / 3 = $100
  • Buy 1 SOL at $140 → position 4 SOL, average cost (300 + 140) / 4 = $110
  • Sell 2 SOL at $160 → realized P&L = 2 × (160 − 110) = +$100

The remaining 2 SOL keep the $110 average cost — a sale does not change it. At a live price of $150 the unrealized P&L on what is left is 2 × (150 − 110) = +$80, so total P&L is $180.

Why your tracker and your exchange disagree

Even with identical arithmetic, two systems will differ if they are looking at different trades. The usual causes:

  • Partial history. Most exchange APIs return trades per symbol, not per account. A pair nobody asked for is a pair whose trades are missing.
  • Per-fill vs per-order. One market order can execute as a dozen fills at a dozen prices. Collapsing them to one row at one price shifts the average cost.
  • Fees. A fee paid in a third asset is itself a disposal. Ignoring fees flatters every number in the report.
  • Pre-history holdings. If you held the coin before the earliest transaction the tracker can see, its cost basis is unknowable from the data. Honest handling is to say so, not to assume zero — assuming zero reports the whole balance as profit.

The practical test of a tracker is not whether it can multiply. It is whether the quantity it thinks you hold matches the balance actually on-chain, and whether it tells you when it does not.

Track it instead of calculating it

Crypto Stats does this arithmetic for every wallet and exchange you connect, read-only, and keeps it current.

Start free
HomeGuidesEarn RatesTerms of UsePrivacy PolicyFeedbackDelete Account

© 2026 Crypto Stats. All rights reserved.