- How is spot PnL calculated?
In a spot account, PnL is generally calculated using the following components:
Realized PnL
PnL generated from completed buy and sell transactions = Net income from sales − Corresponding purchase cost.
Unrealized PnL
The floating PnL on current positions are calculated based on the current market price, defined as: Current market value - Historical position cost.
Fees
Include buy trading fees and sell trading fees. These are typically either included in cost or deducted from income.
Changes in total account assets
This does not equal trading PnL alone, as it also includes:
- Deposits/withdrawals/transfers
- Airdrops and event rewards
- Exchange rate fluctuations (if assets are valued in fiat currency)
- FAQ
1. Cost price and position PnL display as empty after transferring assets from the fund account to the spot account
Issue description:
After transferring an asset directly from the fund account to the spot account, the asset's "Cost price" and "Position PnL" in the spot account may appear empty or unavailable.
Reason:
A transfer from the fund account to the spot account is essentially an internal transfer of the same asset between different account types and does not constitute a buy or sell transaction.
As a result, the system cannot derive a unified historical buy cost from this type of transfer and therefore will not automatically generate cost price or PnL data.
Before any spot trading occurs for the asset, the "Cost price" and "Position PnL" fields will remain empty.
System behavior:
This does not affect the security or quantity of your actual assets and only impacts the display of "Cost price/PnL".
Once you complete a spot transaction using the asset in the spot account (for example, selling the asset or using it to purchase another asset), the system will automatically begin to:
(1) Calculate a new cost price;
(2) Track the PnL data of subsequent holdings.
You can also manually set or edit the cost price of the asset.
2. Cost price calculation methods
To help users manage position costs using different calculation methods, spot assets support two types of cost price:
Average cost price
Definition
Average cost price refers to the average buy price per unit calculated solely based on buy transactions, without considering the impact of sell transactions on cost.
Calculation method (updated dynamically whenever a new buy transaction occurs):
Average cost price = (Average cost price before the latest buy * Pre-buy position quantity + Latest buy price * Latest buy quantity)
/ Current total position quantity
Where:
Pre-buy position quantity: The quantity of the asset held in the spot account before the latest change.
Latest buy quantity: The quantity purchased in the latest transaction.
Current total position quantity: Pre-buy position quantity + Latest buy quantity
(4) Cumulative cost price
Definition
Cumulative cost price takes both historical buy and sell transactions into account and calculates the per-unit cost price based on net buy value. This method is closer to the cost basis commonly used in accounting or tax reporting scenarios.
Calculation method:
Cumulative cost price = (Cumulative buy value - Cumulative sell value) / Net buy quantity
Where:
Cumulative buy value: Σ (Buy price * Buy quantity) for all buy transactions
Cumulative sell value: Σ (Sell price * Sell quantity) for all sell transactions
Net buy quantity: Cumulative buy quantity - Cumulative sell quantity
When the net buy quantity is 0 or negative, the cost price may appear empty or may not be calculated temporarily.
(5) Notes
Data effective date
Average cost price data has been calculated starting from 2025-01-01.
Cumulative cost price data has been calculated starting from 2025-01-01.
Historical transactions prior to this date may not be included in the unified calculation of the above cost methods.
Cost price is provided for statistical and display purposes only and does not affect your actual asset quantity or available balance.
Manual adjustment of cost price
If you believe the cost price calculated by the system differs from your personal records, you may modify it as needed to better align with your own accounting or investment management practices.
3. Ignoring trading fees
Common question:
"I bought at 100 and sold at 110, the profit should be 10 USDT. Why does the platform show a PnL of only around 9 USDT?"
Illustration:
Buy: 100 USDT, fee 0.1 USDT
Sell: 110 USDT, fee 0.11 USDT
| Item | Incorrect | Correct |
| Buy cost | 100 | 100 + 0.1 = 100.1 |
| Net income from sales | 110 | 110 - 0.11 = 109.89 |
| Realized PnL | 110 - 100 = +10 | 109.89 - 100.1 = +9.79 |
Key point: Spot PnL includes trading fees on both the buy and sell sides in the cost and income calculation. As a result, the actual profit or loss will always be less than or equal to the amount calculated based solely on the price difference.
4. The difference between realized PnL and unrealized PnL
Common question:
"I made a total profit of 2,000 USDT on this coin but only sold part of it, why isn't my realized PnL 2,000 USDT?"
Fact:
Realized PnL only comes from the portion that has actually been sold.
The profit or loss associated with the remaining holdings is still considered unrealized PnL.
Illustration:
Total position cost: 10,000 USDT
Current total value: 12,000 USDT (overall unrealized profit of 2,000 USDT)
Only 1/4 of the position has been sold
| Item | Incorrect | Correct |
| Overall unrealized profit | Treated as fully "realized" profit | Realized PnL can only be calculated based on the 1/4 portion that has been sold |
| Remaining 3/4 of the position | Considered as already "secured profit" | Still unrealized PnL and continues to fluctuate with market prices |
Key point: Realized PnL in spot trading is tied to the quantity sold. If the asset has not been sold, there is no realized PnL.