Understanding Spot Trading
Spot trading refers to the direct exchange of one cryptocurrency for another at current market prices. For example, in the ETH/BTC trading pair, ETH acts as the base currency while BTC serves as the quote currency - essentially meaning you're using Bitcoin to purchase Ethereum.
๐ Discover the best spot trading platforms
Major trading zones include:
- USDT trading zone
- USDC trading zone
- Crypto trading zone
- Stablecoin trading zone
Cost Price Calculation in Spot Trading
OKX introduced spot cost price calculation on August 29, 2024, featuring two distinct methods:
Cost Price Overview
| Metric | Average Cost Price | Cumulative Cost Price |
|---|---|---|
| Definition | Average purchase price | Net cost considering all trades |
| Calculation | (Prior avg ร Qty + New price ร Qty) / Net quantity | (Total buy value - Total sell value) / Net quantity |
| Profit Formula | (Current price - Cost) ร Net qty | Current price ร Net qty - Total buy + Total sell |
| ROI Calculation | (Current - Cost)/Cost | Profit/(Total buy - Total sell) |
| Best Use Case | Buy/sell timing decisions | Optimal selling point analysis |
Practical Calculation Examples
Scenario 1: Initial Purchase
- Buy 2 ETH @ 3,000 with current price @ 3,500
Average Cost: 3,000
- Profit: (3,500-3,000)ร2 = 1,000
- ROI: 16.67%
Cumulative Cost: 3,000
- Same results initially
Scenario 2: Partial Sale
- Sell 1 ETH @ 3,500 (current @ 4,000)
Average Cost: Maintains 3,000
- Profit: 1,000 (33.3% ROI)
Cumulative Cost: 2,500
- Profit: 1,500 (60% ROI)
Scenario 3: Additional Purchase
- Buy 1 ETH @ 4,000 (current @ 4,500)
Average Cost: 3,500
- Profit: 2,000 (28.6% ROI)
Cumulative Cost: 3,250
- Profit: 2,500 (38.5% ROI)
Key Considerations
- Cost calculations only apply to trades occurring after implementation date
- Future updates will allow manual cost price adjustments
- Only spot trades and strategy transfers included
- Stablecoins and fiat excluded from cost calculations
๐ Master cryptocurrency cost analysis
API Integration Fields
Developers can access these cost metrics through:
| Field | Description |
|---|---|
| openAvgPx | Average cost price |
| accAvgPx | Cumulative cost price |
| spotUpl | Realized profit |
| spotUplRatio | Profit percentage |
| spotBal | Net quantity held |
FAQ Section
Q: Which trading pairs support cost price tracking?
A: All cryptocurrency pairs except stablecoin/fiat combinations.
Q: How often do cost prices update?
A: In real-time with each executed trade.
Q: Can I see historical cost price data?
A: Currently only from implementation date forward.
Q: Why do the two cost methods show different results?
A: They serve different analytical purposes - average for entry points, cumulative for exit strategy.
Q: Are leveraged positions included?
A: No, only pure spot market trades.
Q: How does selling affect my average cost?
A: Sales don't alter average cost for remaining holdings under the average method, but significantly impact cumulative calculations.