Home Features Pricing FAQ Blog Help Privacy Policy Terms of Service
Feature Spotlights

How Coinlio Tracks P&L per Coin — the Math Behind the Numbers

A plain-English look at how Coinlio calculates profit and loss per coin. Average cost, partial sells, fees, and what FIFO/LIFO will change later.

← All posts
Feature Spotlights 7 min read
Share this article:

Why the P&L number on your app never feels quite right

You bought Ethereum three times, at three different prices. You sold a little. You paid a fee each time. Now your portfolio says you are up $340. Is that right?

If you have ever stared at a P&L number and thought "where did that come from," you are not alone. Profit and loss math on crypto is simple in theory and messy in practice, mostly because the numbers depend on which accounting method the app uses — and most apps never tell you.

📝 Note
This post opens the hood on Coinlio. You will see the exact method we use today (average cost), a worked example with real numbers, and what changes later when FIFO and LIFO ship. No jargon that we do not define.

The three numbers Coinlio tracks per coin

Every coin in your portfolio has three cornerstone numbers. Every other P&L number is built from these.

From there:

"Unrealized" just means you have not sold yet. Once you sell, that portion becomes realized P&L and stops changing.

📝 Note
Cost basis is an accounting term for "what you paid." Same thing. We use both in the app because different users are used to different words.

The method Coinlio uses today — average cost

When you buy the same coin more than once, we blend the prices into a single average. That average becomes the cost basis for every unit you hold. When you sell, we subtract at that average.

Here is the formula, then the plain-English version.

average_cost = total_paid_across_all_buys ÷ total_quantity_bought

In English: if you bought 1 ETH at $2,000 and another 1 ETH at $4,000, you paid $6,000 for 2 ETH. Your average cost is $3,000 per ETH. That number is what Coinlio compares to the live market price when it shows your P&L.

Average cost treats every unit of the same coin as identical — it does not care which one you bought first.


A worked example — 5 transactions, one ETH position

Let us walk through a realistic sequence. You bought Ethereum three times, sold once, and the market moved. Here is what Coinlio shows you after each transaction, and why.

1
Buy 1 ETH at $2,000, fee $10
You paid $2,010 total. Quantity: 1 ETH. Invested: $2,010. Average cost: $2,010 per ETH.
2
Buy 2 ETH at $2,500, fee $20
You paid another $5,020. Quantity: 3 ETH. Invested: $2,010 + $5,020 = $7,030. Average cost: $7,030 ÷ 3 = $2,343.33 per ETH.
3
Market moves to $3,000
Current value: 3 × $3,000 = $9,000. Invested: $7,030. Unrealized P&L: +$1,970.
4
Sell 1 ETH at $3,000, fee $15
You received $2,985 in cash. At average cost, that 1 ETH "cost" $2,343.33. Realized P&L on the sell: $2,985 − $2,343.33 = +$641.67. Your remaining 2 ETH still has average cost $2,343.33 (sell does not move the average). Invested on what you still hold: 2 × $2,343.33 = $4,686.66.
5
Buy 0.5 ETH at $2,800, fee $5
You paid $1,405. Quantity: 2.5 ETH. Invested: $4,686.66 + $1,405 = $6,091.66. New average cost: $6,091.66 ÷ 2.5 = $2,436.66 per ETH.

Every number in your portfolio comes from that sequence. If you can follow the steps, you can audit your own P&L at any time.


Edge cases that trip people up

Crypto has more edges than a typical investment. Here is how Coinlio handles the common ones.

CaseWhat the app doesWhat you should know
Fees on buyAdded to invested (raises cost basis)A $10 fee on a $2,000 buy gives a cost basis of $2,010 — your real break-even price
Fees on sellSubtracted from proceeds (lowers realized P&L)A $15 fee on a $2,985 sell leaves you with $2,970 received
Partial sellPulls at the average, leaves average unchangedRemaining units keep the same cost basis per coin
Full sell then rebuyPosition resets, new average starts from next buyYou are starting fresh — old P&L is realized, new cost basis begins
Transferring between walletsNot a Buy or SellTag as Transfer so it does not change your cost basis
Airdrops and rewardsAdded at $0 cost by default (you can edit)Selling later shows as pure profit — correct for tax in most regions but confirm with your local rules
Staking rewardsSame as airdrops — $0 cost by defaultEdit the cost if your jurisdiction treats rewards as income at receipt
⚠️ Warning
The $0-cost default for airdrops and rewards is the simplest starting point, not tax advice. If you file taxes on crypto, check how your country treats rewards — some require you to record the market price at receipt as income.

Why average cost and not FIFO or LIFO?

Average cost is the right default for most retail investors for three reasons.

That said, average cost is not the best method for everyone. Active traders and users in certain tax regimes want to pick exactly which purchase they are selling from. That is what FIFO and LIFO do.


What is coming later — FIFO and LIFO

Coinlio will add FIFO (First In, First Out) and LIFO (Last In, First Out) in a later release, as part of the Pro tier. No hard date yet — we will ship it when we can do it well, not when a marketing plan says we should.

Here is how each one changes the math on the same sell, using the example above.

MethodHow it picks cost basis on a sellRealized P&L on the 1 ETH sold at $2,985
Average cost (today)Blends all buys into one averageSell proceeds $2,985 − avg cost $2,343.33 = +$641.67
FIFO (later)Uses the oldest unsold buy firstSell proceeds $2,985 − first-buy cost $2,010 = +$975.00
LIFO (later)Uses the newest unsold buy firstSell proceeds $2,985 − newest-buy cost (half of the 2-ETH buy) ≈ $2,510 = +$475.00

Same trade, three answers. None are wrong — they are different accounting choices. For taxes, your country's rules decide which method you must or may use. For feel, some people want to "sell their oldest coins first" emotionally. Coinlio will let you pick.

📝 Note
Until FIFO and LIFO ship, you can always export your transactions to CSV (Pro feature) and run the other methods in a spreadsheet if your accountant needs them.

How to audit your own P&L in 60 seconds

If a number in Coinlio looks wrong, do this check. It works for any coin, any method.

1
Open the coin's detail screen
Note Quantity held and Invested.
2
Divide Invested by Quantity held
That is your current average cost.
3
Multiply Quantity held by today's market price
That is your current value.
4
Subtract Invested from current value
That should match the unrealized P&L on screen, to the cent.

If it does not match, nine times out of ten it is one transaction — a wrong quantity, a wrong price, or a missing fee. Scroll your transaction list, find the odd one, edit it. The whole portfolio recalculates instantly.

Your P&L number is not magic. It is one formula, three inputs per coin, and a method you chose (or that we chose as default). Understand the method, and the number always makes sense.
Try Coinlio free — add your transactions and watch every number above recalculate live. <a href="https://apps.apple.com/app/id6761177479">Download on the App Store</a>.

Try Coinlio Free

3 portfolios, unlimited assets, zero data selling. Download now on the App Store.

Try Coinlio Free →
Link copied!