Files
nofx/market
ZhouYongyou 3f5bb5ca84 fix(market): resolve price staleness issue in GetCurrentKlines
## Problem
GetCurrentKlines had two critical bugs causing price data to become stale:
1. Incorrect return logic: returned error even when data fetch succeeded
2. Race condition: returned slice reference instead of deep copy, causing concurrent data corruption
## Impact
- BTC price stuck at 106xxx while actual market price was 107xxx+
- LLM calculated take-profit based on stale prices → orders failed validation
- Statistics showed incorrect P&L (0.00%) due to corrupted historical data
- Alt-coins filtered out due to failed market data fetch
## Solution
1. Fixed return logic: only return error when actual failure occurs
2. Return deep copy instead of reference to prevent race conditions
3. Downgrade subscription errors to warnings (non-blocking)
## Test Results
 Price updates in real-time
 Take-profit orders execute successfully
 P&L calculations accurate
 Alt-coins now tradeable
Related: Price feed mechanism, concurrent data access
2025-11-04 17:21:47 +08:00
..
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00