Skip to content
Beginner 20 min read 2026-04-08

How to Calculate Crypto Profit and Loss: The Complete Guide

Every formula you need — spot P&L, futures P&L, ROI, unrealized vs realized, fees impact, DCA cost basis, portfolio tracking, and real-world calculation examples.

#profit #loss #P&L #ROI #cost basis #unrealized #realized #portfolio

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:

DateAmountPriceCost
Jan 10.05 BTC$42,000$2,100
Feb 10.05 BTC$38,000$1,900
Mar 10.05 BTC$45,000$2,250
Total0.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:

DateAmountPriceCost
Jan 10.10 BTC$42,000$4,200
Feb 10.03 BTC$38,000$1,140
Mar 10.02 BTC$45,000$900
Total0.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

ParameterValue
Entry price$60,000
Margin$1,000
Leverage10x
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

ParameterValue
Entry price$3,500
Margin$2,000
Leverage5x
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:

ParameterValue
Position size$10,000 long
Entry price$60,000
Exit price$63,000
Held for3 days (9 funding periods)
Trading fee0.04% per side
Avg funding rate0.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

  1. Taxes: You typically only pay taxes on realized gains. Unrealized gains aren’t taxable in most jurisdictions (but check yours).
  2. 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.
  3. Portfolio assessment: Knowing both gives you a complete picture of your investment health.

Portfolio-Level P&L

Tracking Multiple Positions

AssetAmountCost BasisCurrent PriceCurrent ValueUnrealized P&LP&L %
BTC0.15$41,600$65,000$9,750+$3,510+56.3%
ETH2.0$2,800$3,200$6,400+$800+14.3%
SOL50$85$140$7,000+$2,750+64.7%
LINK200$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

ScenarioFee per TradeTotal 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)

NetworkTypical Swap CostImpact on $100 TradeImpact on $10,000 Trade
Ethereum L1$5–$505–50% (!!!)0.05–0.5%
Arbitrum$0.01–$0.100.01–0.1%negligible
Base$0.001–$0.05negligiblenegligible
Solana$0.001–$0.01negligiblenegligible

On Ethereum mainnet, gas fees make small DeFi trades unprofitable. Always factor gas into your P&L.

Funding Rate Impact (Futures)

Holding PeriodFunding Rate 0.01%Funding Rate 0.05%Funding Rate 0.1%
1 day0.03%0.15%0.3%
1 week0.21%1.05%2.1%
1 month0.9%4.5%9.0%
3 months2.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:

  1. Trading fees earned
  2. Impermanent loss
  3. 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

ToolFree TierBest For
CoinGecko PortfolioYesSimple buy/hold tracking
CoinMarketCap PortfolioYesQuick overview
KoinlyYes (basic)Tax-ready tracking
DeBankYesDeFi position tracking
ZerionYesMulti-chain DeFi + wallet
Delta AppYesMobile portfolio + alerts
3CommasPaidActive trading P&L

Build Your Own Spreadsheet

For maximum control, a spreadsheet works:

DateActionAssetAmountPriceFeesCost BasisNotes
2026-01-15BuyBTC0.05$42,000$2.10$2,102.10DCA #1
2026-02-15BuyBTC0.05$38,000$1.90$1,901.90DCA #2
2026-03-15SellBTC0.03$50,000$1.50FIFO: $42KPartial 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

  1. Ignoring fees. Trading fees, gas fees, withdrawal fees, funding rates — they all count. A “profitable” trade can be a net loss after fees.

  2. 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.

  3. Not tracking cost basis. After 50 buys at different prices, you need to know your average cost to calculate P&L accurately.

  4. Counting unrealized as realized. Showing friends your “gains” when you haven’t sold means nothing. Markets can reverse.

  5. Ignoring opportunity cost. Your 20% crypto gain might underperform the 25% you could have earned in a different investment over the same period.

  6. Forgetting about taxes. A $10,000 gain with 30% tax rate leaves you $7,000. Factor taxes into your real return.


Key Takeaways

  1. Always calculate P&L including ALL fees — trading fees, gas, funding rates, withdrawal fees
  2. Use total cost / total amount for average cost basis, not the arithmetic average of prices
  3. Unrealized P&L is not real money — only realized P&L is locked in (and taxable)
  4. Futures P&L multiplies with leverage but so do costs — funding rates compound significantly over time
  5. DeFi returns require factoring in impermanent loss, gas costs, and reward token depreciation
  6. 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.

Start Trading

We may earn a commission when you sign up through our referral links.