How to Calculate Crypto Profit and Loss: The Complete Guide
Knowing whether you’re actually making or losing money sounds simple. It isn’t. Between multiple buys at different prices, trading fees, funding rates, gas costs, staking rewards, and impermanent loss — calculating your real profit requires more than subtracting your buy price from the current price.
This guide covers every P&L scenario you’ll encounter, with real formulas and worked examples.
The Basic Formula
At its core:
Profit or Loss = Selling Price - Buying Price - All Fees
Or in percentage:
ROI (%) = ((Current Value - Total Cost) / Total Cost) × 100
Seems simple. But the complexity hides in “Total Cost” — which includes much more than the purchase price.
Spot Trading P&L
Single Buy, Single Sell
The simplest case.
Example:
- Buy 0.5 ETH at $3,000 per ETH
- Sell 0.5 ETH at $3,800 per ETH
- Exchange fee: 0.1% per trade
Buy cost: 0.5 × $3,000 = $1,500.00
Buy fee: $1,500 × 0.1% = $1.50
Total invested: $1,501.50
Sell proceeds: 0.5 × $3,800 = $1,900.00
Sell fee: $1,900 × 0.1% = $1.90
Net proceeds: $1,898.10
Profit: $1,898.10 - $1,501.50 = $396.60
ROI: ($396.60 / $1,501.50) × 100 = 26.41%
Without accounting for fees, you’d think your profit is $400 (26.67%). The actual profit is $396.60 (26.41%). On small amounts, the difference is negligible. On large amounts or many trades, fees compound significantly.
Multiple Buys at Different Prices (DCA)
This is where most people get confused. You bought Bitcoin at three different prices — what’s your average cost?
Example:
| Date | Amount | Price | Cost |
|---|---|---|---|
| Jan 1 | 0.05 BTC | $42,000 | $2,100 |
| Feb 1 | 0.05 BTC | $38,000 | $1,900 |
| Mar 1 | 0.05 BTC | $45,000 | $2,250 |
| Total | 0.15 BTC | — | $6,250 |
Average cost per BTC = Total Cost / Total BTC = $6,250 / 0.15 = $41,666.67
Note: the average cost ($41,666.67) is NOT the arithmetic average of the three prices ($41,666.67… actually it is in this case because you bought equal amounts). But if you bought different amounts:
| Date | Amount | Price | Cost |
|---|---|---|---|
| Jan 1 | 0.10 BTC | $42,000 | $4,200 |
| Feb 1 | 0.03 BTC | $38,000 | $1,140 |
| Mar 1 | 0.02 BTC | $45,000 | $900 |
| Total | 0.15 BTC | — | $6,240 |
Average cost per BTC = $6,240 / 0.15 = $41,600
Arithmetic average of prices = ($42,000 + $38,000 + $45,000) / 3 = $41,667
These are DIFFERENT numbers. Always use total cost / total amount.
Current value and P&L:
BTC is now $65,000.
Current value: 0.15 × $65,000 = $9,750
Total cost: $6,240
Profit: $9,750 - $6,240 = $3,510
ROI: ($3,510 / $6,240) × 100 = 56.25%
Partial Sells
You own 0.15 BTC (cost basis $41,600/BTC) and sell 0.05 BTC at $65,000.
FIFO (First In, First Out): Your first purchase was at $42,000, so the cost basis for the first 0.05 BTC is $42,000.
Proceeds: 0.05 × $65,000 = $3,250
Cost (FIFO): 0.05 × $42,000 = $2,100
Profit: $3,250 - $2,100 = $1,150
Remaining holdings:
0.10 BTC at cost basis from Feb + Mar purchases
Average Cost Method: Use your overall average cost basis.
Proceeds: 0.05 × $65,000 = $3,250
Cost (average): 0.05 × $41,600 = $2,080
Profit: $3,250 - $2,080 = $1,170
The method you use affects your reported profit and tax liability. Check which method your jurisdiction requires or allows.
Futures Trading P&L
Long Position P&L
P&L = Position Size × ((Exit Price - Entry Price) / Entry Price)
Or equivalently:
P&L = Quantity × (Exit Price - Entry Price)
Example: 10x long on BTC
| Parameter | Value |
|---|---|
| Entry price | $60,000 |
| Margin | $1,000 |
| Leverage | 10x |
| Position size | $10,000 (0.1667 BTC) |
| Exit price | $63,000 |
P&L = 0.1667 × ($63,000 - $60,000) = 0.1667 × $3,000 = $500.00
ROI on margin = ($500 / $1,000) × 100 = 50%
The price moved 5%, but your return is 50% because of 10x leverage.
Short Position P&L
P&L = Position Size × ((Entry Price - Exit Price) / Entry Price)
Example: 5x short on ETH
| Parameter | Value |
|---|---|
| Entry price | $3,500 |
| Margin | $2,000 |
| Leverage | 5x |
| Position size | $10,000 |
| Exit price | $3,200 |
P&L = ($10,000 / $3,500) × ($3,500 - $3,200)
= 2.857 ETH × $300 = $857.14
ROI on margin = ($857.14 / $2,000) × 100 = 42.86%
ETH dropped 8.57%, your return on margin is 42.86% (5x leverage × 8.57%).
Including Fees and Funding
Real P&L must account for all costs:
Net P&L = Gross P&L - Opening Fee - Closing Fee - Funding Costs
Full example:
| Parameter | Value |
|---|---|
| Position size | $10,000 long |
| Entry price | $60,000 |
| Exit price | $63,000 |
| Held for | 3 days (9 funding periods) |
| Trading fee | 0.04% per side |
| Avg funding rate | 0.01% per 8 hours |
Gross P&L: $500.00
Opening fee: $10,000 × 0.04% = -$4.00
Closing fee: $10,000 × 0.04% = -$4.00
Funding: $10,000 × 0.01% × 9 = -$9.00
─────────────────────────────────────────
Net P&L: $500 - $4 - $4 - $9 = $483.00
Effective ROI: ($483 / $1,000) × 100 = 48.3%
When You Get Liquidated
Example: 20x long on BTC at $60,000
Margin: $500
Position: $10,000
Liquidation price: $60,000 × (1 - 1/20) = $57,000
Liquidation fee: ~$10,000 × 0.5% = $50
You lose: $500 (entire margin)
After liq fee: Insurance fund gets $50, you get $0
Unrealized vs. Realized P&L
Unrealized (Paper) Profit/Loss
You hold a position but haven’t closed it. The profit/loss exists “on paper” but hasn’t been locked in.
Unrealized P&L = Current Market Value - Cost Basis
Example:
- You bought 1 ETH at $2,500
- ETH is now $3,200
- Unrealized profit: $700
This $700 is not real money until you sell. It can increase or decrease with price movement.
Realized Profit/Loss
You’ve closed the position — sold, swapped, or spent the crypto. The profit/loss is now locked in and usually triggers a tax event.
Realized P&L = Selling Proceeds - Cost Basis - Fees
Why the Distinction Matters
- Taxes: You typically only pay taxes on realized gains. Unrealized gains aren’t taxable in most jurisdictions (but check yours).
- Psychology: Treating unrealized gains as “your money” leads to poor decisions. An 80% unrealized gain can turn into a 50% unrealized loss if you don’t take profits.
- Portfolio assessment: Knowing both gives you a complete picture of your investment health.
Portfolio-Level P&L
Tracking Multiple Positions
| Asset | Amount | Cost Basis | Current Price | Current Value | Unrealized P&L | P&L % |
|---|---|---|---|---|---|---|
| BTC | 0.15 | $41,600 | $65,000 | $9,750 | +$3,510 | +56.3% |
| ETH | 2.0 | $2,800 | $3,200 | $6,400 | +$800 | +14.3% |
| SOL | 50 | $85 | $140 | $7,000 | +$2,750 | +64.7% |
| LINK | 200 | $18 | $14 | $2,800 | -$800 | -22.2% |
| Total | — | $17,260 | — | $25,950 | +$6,260 | +36.3% |
Weighted vs. Unweighted Returns
Your portfolio return isn’t the average of individual returns. It’s weighted by position size.
Unweighted average: (56.3 + 14.3 + 64.7 - 22.2) / 4 = 28.3% Actual portfolio return: $6,260 / $17,260 = 36.3%
The difference exists because your best-performing assets (BTC, SOL) have larger positions than your worst (LINK).
Including Realized Gains
If you’ve already sold some crypto at a profit:
Total P&L = Unrealized P&L (current holdings) + Realized P&L (closed positions)
Total ROI = Total P&L / Total Capital Invested × 100
The True Cost of Trading
Most people underestimate how much trading costs eat into returns.
Fee Impact Over 100 Trades
| Scenario | Fee per Trade | Total Fees (100 trades) | Impact on $10,000 |
|---|---|---|---|
| Spot (pro interface) | 0.1% | 10% | $1,000 |
| Spot (simple buy) | 1.5% | 150% | $15,000 (!!) |
| Futures (maker) | 0.02% | 2% | $200 |
| Futures (taker) | 0.05% | 5% | $500 |
A day trader making 5 round-trip trades per day × 0.1% fee = 1% per day in fees. That’s 365% annually just in fees. You need to make more than 1% per day just to break even.
Gas Fees (On-Chain Transactions)
| Network | Typical Swap Cost | Impact on $100 Trade | Impact on $10,000 Trade |
|---|---|---|---|
| Ethereum L1 | $5–$50 | 5–50% (!!!) | 0.05–0.5% |
| Arbitrum | $0.01–$0.10 | 0.01–0.1% | negligible |
| Base | $0.001–$0.05 | negligible | negligible |
| Solana | $0.001–$0.01 | negligible | negligible |
On Ethereum mainnet, gas fees make small DeFi trades unprofitable. Always factor gas into your P&L.
Funding Rate Impact (Futures)
| Holding Period | Funding Rate 0.01% | Funding Rate 0.05% | Funding Rate 0.1% |
|---|---|---|---|
| 1 day | 0.03% | 0.15% | 0.3% |
| 1 week | 0.21% | 1.05% | 2.1% |
| 1 month | 0.9% | 4.5% | 9.0% |
| 3 months | 2.7% | 13.5% | 27.0% |
A leveraged position held for months can lose a significant chunk of returns to funding alone, even if the trade direction is correct.
DeFi P&L Calculations
Liquidity Pool Returns
Calculating LP returns requires accounting for:
- Trading fees earned
- Impermanent loss
- Incentive rewards (if any)
Example: You provide $5,000 ETH + $5,000 USDC to a Uniswap pool.
After 30 days, ETH went up 20%:
If you just held:
ETH: $5,000 × 1.2 = $6,000
USDC: $5,000
Total: $11,000
In the pool:
Due to rebalancing, the pool adjusted your holdings
You now have: ~$5,477 ETH + $5,477 USDC = $10,954
Impermanent loss: $11,000 - $10,954 = $46 (0.42%)
Trading fees earned: Let's say $150
Net result: $10,954 + $150 = $11,104
Net profit vs. holding: $11,104 - $11,000 = $104
Net profit vs. initial: $11,104 - $10,000 = $1,104 (11.04%)
In this case, fees more than offset impermanent loss. But with a larger price move or lower fees, impermanent loss wins.
Staking Returns
Staking Profit = Staked Amount × APY × Time Period
Example: Stake 10 ETH at 4% APY for 6 months.
Rewards: 10 × 0.04 × 0.5 = 0.2 ETH
But the ETH you earned is also subject to price changes. If ETH dropped 30% during those 6 months:
Initial value: 10 × $3,000 = $30,000
After 6 months: 10.2 × $2,100 = $21,420
Unrealized P&L: $21,420 - $30,000 = -$8,580 (-28.6%)
You earned 0.2 ETH in staking, but lost $8,580 in price decline. Staking returns don’t protect against price risk.
Yield Farming
When a DeFi protocol pays you in its own token:
Real Yield = (Token Rewards × Token Price at Claim) - Gas Fees - Opportunity Cost
If the reward token drops 80% after you earn it, your “100% APY” turned into 20% APY. Always convert rewards to stablecoins or established assets if you want to lock in gains.
P&L Tracking Tools
| Tool | Free Tier | Best For |
|---|---|---|
| CoinGecko Portfolio | Yes | Simple buy/hold tracking |
| CoinMarketCap Portfolio | Yes | Quick overview |
| Koinly | Yes (basic) | Tax-ready tracking |
| DeBank | Yes | DeFi position tracking |
| Zerion | Yes | Multi-chain DeFi + wallet |
| Delta App | Yes | Mobile portfolio + alerts |
| 3Commas | Paid | Active trading P&L |
Build Your Own Spreadsheet
For maximum control, a spreadsheet works:
| Date | Action | Asset | Amount | Price | Fees | Cost Basis | Notes |
|---|---|---|---|---|---|---|---|
| 2026-01-15 | Buy | BTC | 0.05 | $42,000 | $2.10 | $2,102.10 | DCA #1 |
| 2026-02-15 | Buy | BTC | 0.05 | $38,000 | $1.90 | $1,901.90 | DCA #2 |
| 2026-03-15 | Sell | BTC | 0.03 | $50,000 | $1.50 | FIFO: $42K | Partial exit |
Formulas:
Total Cost = SUM(Buy amounts × Buy prices + Buy fees)
Current Value = Holdings × Current Price
Unrealized P&L = Current Value - Remaining Cost Basis
Total ROI = (Unrealized P&L + Realized P&L) / Total Invested × 100
Common P&L Mistakes
-
Ignoring fees. Trading fees, gas fees, withdrawal fees, funding rates — they all count. A “profitable” trade can be a net loss after fees.
-
Confusing price change with portfolio change. If BTC goes from $60K to $66K (+10%), but you only have 0.01 BTC, your gain is $60, not $6,000.
-
Not tracking cost basis. After 50 buys at different prices, you need to know your average cost to calculate P&L accurately.
-
Counting unrealized as realized. Showing friends your “gains” when you haven’t sold means nothing. Markets can reverse.
-
Ignoring opportunity cost. Your 20% crypto gain might underperform the 25% you could have earned in a different investment over the same period.
-
Forgetting about taxes. A $10,000 gain with 30% tax rate leaves you $7,000. Factor taxes into your real return.
Key Takeaways
- Always calculate P&L including ALL fees — trading fees, gas, funding rates, withdrawal fees
- Use total cost / total amount for average cost basis, not the arithmetic average of prices
- Unrealized P&L is not real money — only realized P&L is locked in (and taxable)
- Futures P&L multiplies with leverage but so do costs — funding rates compound significantly over time
- DeFi returns require factoring in impermanent loss, gas costs, and reward token depreciation
- Track everything from day one — reconstructing transaction history later is painful and error-prone
FAQ
Q: How do I calculate P&L when I’ve bought the same coin many times? A: Sum all your purchase costs and divide by total amount to get average cost basis. Or use FIFO (first purchase cost assigned to first sale). Track every buy in a spreadsheet or portfolio tracker.
Q: Does sending crypto between wallets affect my P&L? A: No — transfers between your own wallets aren’t buys or sells. But gas fees for the transfer are a cost that reduces your overall returns. Track them.
Q: How do I account for staking rewards in my cost basis? A: Staking rewards are typically treated as income at their fair market value when received. That value becomes the cost basis for those specific tokens. If you later sell them at a different price, you have a separate capital gain or loss.
Q: What’s a good ROI for crypto? A: Context matters. 20% in a year? Good for most investments. 20% in a bull market where BTC did 100%? Underperformance. Compare against a simple BTC buy-and-hold benchmark. If your active trading underperforms that, you’d be better off just holding BTC.
Q: How do I track P&L across multiple exchanges and wallets? A: Use a portfolio aggregator like Koinly, CoinTracker, or DeBank that connects to exchanges via API and reads wallet addresses on-chain. Manual spreadsheets work but become unwieldy with 100+ transactions.