Skip to content
🌐Network: Mainnet

Understanding P&L (Profit and Loss)

o2 Exchange tracks your trading performance through Profit and Loss (P&L) calculations. Competitions use a configurable scoring rule depending on the competition, both realized and unrealized P&L plus trading volume can contribute to your score.

Click to View Live Leaderboard

How P&L is Calculated

Your Cost Basis (Average Entry Price)

When you buy the same asset multiple times, o2 calculates a weighted average:

Average Entry Price = (Qty1 × Price1 + Qty2 × Price2 + ...) / Total Quantity

Key rule: Average updates when you buy more, never when you sell.

When You Sell

Realized P&L = Quantity Sold × (Sell Price - Average Entry Price)

Example:

Buy 1 BTC @ $50,000
Buy 2 BTC @ $53,000
Average entry: ($50k + $106k) / 3 = $52,000

Sell 1 BTC @ $55,000
Realized P&L: 1 × ($55,000 - $52,000) = $3,000

Note: Fees are tracked separately and do not affect P&L calculations.

Types of P&L

TypeRealized P&LUnrealized P&L
What it isLocked-in profits/losses from closed positionsPaper gains/losses on open positions
WithdrawableYes, can be withdrawnNo, must close position first
LeaderboardImportant input to your competition score (depending on rule type)May affect competition score for P&L-based rules (e.g. P&L_ONLY or volume-with-P&L multiplier)
UpdatesPeriodically (1-5 minute delay)Changes constantly with market prices
Counts for competitionsYes, when P&L is part of the configured ruleYes for P&L-based rules; no for pure volume competitions

P&L Calculation Examples

Understanding P&L is best learned through real scenarios showing complete calculations.

Example 1: Simple Trade

Scenario: Buy and sell BTC for profit

Step 1: Buy 1 BTC @ $50,000
├─ Position: 1 BTC
├─ Average entry: $50,000
└─ Realized P&L: $0

Step 2: Market moves to $55,000
├─ Unrealized P&L: 1 × ($55,000 - $50,000) = +$5,000
└─ Realized P&L: $0 (nothing locked in yet)

Step 3: Sell 1 BTC @ $55,000
├─ Realized P&L: $55,000 - $50,000 = +$5,000
└─ Unrealized P&L: $0 (no position)

Example 2: Multiple Purchases

Scenario: Accumulate position at different prices

Day 1: Buy 1 BTC @ $48,000
├─ Position: 1 BTC
└─ Average entry: $48,000

Day 5: Buy 1 BTC @ $50,000
├─ Position: 2 BTC
└─ Average entry: ($48k + $50k) / 2 = $49,000

Day 10: Buy 2 BTC @ $54,000
├─ Position: 4 BTC
├─ Total cost: $50k + $50k + $108k = $206,000
└─ Average entry: $206,000 / 4 = $51,500

Sell 2 BTC @ $56,000
├─ Realized P&L: 2 × ($56,000 - $51,500) = +$9,000
├─ Remaining: 2 BTC @ $51,500 (average unchanged)
└─ Position value: 2 × $56,000 = $112,000

Key insight: Selling doesn't change your average entry price for remaining position.

Example 3: Deposits and Withdrawals

Important: Deposits and withdrawals affect your P&L calculations.

Deposits = Buys at current market price

Current position: 1 BTC @ $50,000 avg
Market price: $54,000
Deposit: 1 BTC from wallet

Calculation:
Existing: 1 BTC × $50,000 = $50,000
Deposited: 1 BTC × $54,000 = $54,000 (treated as buy at market price)
Total cost: $104,000
New average: $104,000 / 2 BTC = $52,000

Result:
├─ Position: 2 BTC
├─ New average: $52,000
├─ Realized P&L: $0 (deposits don't realize)
└─ Unrealized P&L: 2 × ($54k - $52k) = +$4,000

Withdrawals = Sells at current market price

Position: 2 BTC @ $52,000 avg
Market price: $56,000
Withdraw: 1 BTC to wallet

Result:
├─ Position: 1 BTC @ $52,000 avg (unchanged)
├─ Realized P&L: 1 × ($56k - $52k) = +$4,000
└─ This $4,000 is now locked in!

Critical: Withdrawing realizes your P&L, converting paper gains into actual profits (or losses).

Multiple Markets

o2 supports multiple trading pairs (BTC/USDC, ETH/USDC, FUEL/USDC). Each market tracks P&L independently.

Example portfolio:

BTC/USDC:
├─ Position: 2 BTC
├─ Realized P&L: +$5,000
└─ Unrealized P&L: +$2,000

ETH/USDC:
├─ Position: 10 ETH
├─ Realized P&L: -$1,000
└─ Unrealized P&L: +$500

Total Portfolio:
├─ Realized P&L: $5,000 - $1,000 = +$4,000
└─ Unrealized P&L: $2,000 + $500 = +$2,500