Spot Cost Price: Key Differences and Calculation Methods

·

OKX provides two types of spot cost prices: Asset Summary Spot Cost Price and Trading Account Spot Cost Price. Here’s how they differ:

  1. Asset Summary Spot Cost Price includes assets from the trading account, funding account, and Earn account, while the Trading Account Spot Cost Price only covers assets in the trading account.
  2. The Asset Summary uses the average cost method, whereas the trading account supports both average cost and accumulated cost methods (configurable in settings).

For specific formulas, refer to the examples under Trading Account Spot Cost Price below.


1. Asset Summary Spot Cost Price

Definition:
A weighted average of cost, price, and quantity across all accounts (trading, funding, Earn). Transfers between accounts do not affect this price.

Example:
If your asset summary shows 1 ETH with a cost price of $3,000—even after transferring ETH from the funding to trading account—the cost price remains $3,000.


2. Trading Account Spot Cost Price

2.1 Overview

MetricAverage Cost PriceAccumulated Cost Price
DefinitionAverage purchase priceNet buy/sell price impact
Calculation(Prior Avg Cost × Qty + Last Purchase Price × Qty) / Net Buy Qty(Total Buy Value - Total Sell Value) / Net Buy Qty
P&L(Last Price - Cost) × Net QtyNet Qty × Last Price - Total Buy Value + Total Sell Value
P&L Ratio(Last Price - Cost) / CostP&L / (Total Buy Value - Total Sell Value)
Use CaseTrading decisionsSelling strategy analysis

👉 Compare cost methods side-by-side

2.2 Calculation Examples

Case 1:

Case 2:

Case 3:

2.3 Important Notes

👉 Learn how to edit cost prices

2.4 Open API Data Fields

FieldAverage Cost (openAvgPx)Accumulated Cost (accAvgPx)
Cost PriceopenAvgPxaccAvgPx
P&LspotUpltotalPnl
P&L RatiospotUplRatiototalPnlRatio
Net QtyspotBalspotBal

FAQ

Q1: Which cost method is better for long-term holders?
A1: The average cost method simplifies tracking for buy-and-hold strategies.

Q2: Why does my accumulated cost price change after selling?
A2: It accounts for realized P&L from sales, adjusting your net position value.

Q3: Can I switch cost calculation methods mid-trading?
A3: Yes, but historical data won’t retroactively update—only new trades are affected.

Q4: How do transfers impact cost price?
A4: Transfers reset the cost price. You must manually re-enter it if needed.

Q5: Are fees included in cost price calculations?
A5: No, only trade prices are factored in.

Q6: Why exclude stablecoins?
A6: Their pegged value makes cost tracking irrelevant for P&L analysis.