feat: migrate to CoinAnk API and improve chart UI

- Chart improvements: professional styling, popular symbols quick selection, simplified B/S legend
- Data source migration: use CoinAnk API exclusively for all kline data
- Code cleanup: remove Binance WebSocket cache and related code (websocket_client.go, combined_streams.go, monitor.go)
- Log optimization: reduce hook spam, suppress 404 errors, increase P&L diff threshold
- Lighter integration: add order sync functionality, fix market order precision
- Remove ticker merge logic for simplicity
This commit is contained in:
tinkle-community
2025-12-26 00:58:12 +08:00
parent 54b24167a7
commit 1744e7f38e
38 changed files with 6498 additions and 964 deletions

View File

@@ -389,14 +389,16 @@ func (t *LighterTraderV2) GetTrades(startTime time.Time, limit int) ([]TradeReco
}
}
// Build request URL
startTimeMs := startTime.UnixMilli()
// Build request URL (use Unix timestamp in seconds, not milliseconds)
startTimeSec := startTime.Unix()
endpoint := fmt.Sprintf("%s/api/v1/trades?account_index=%d&start_time=%d",
t.baseURL, t.accountIndex, startTimeMs)
t.baseURL, t.accountIndex, startTimeSec)
if limit > 0 {
endpoint = fmt.Sprintf("%s&limit=%d", endpoint, limit)
}
logger.Infof("🔍 Calling Lighter GetTrades API: %s", endpoint)
req, err := http.NewRequest("GET", endpoint, nil)
if err != nil {
return nil, fmt.Errorf("failed to create request: %w", err)