fix: preserve futures token identity in canonical cache
Keep futureToken2Symbol keyed by raw futures token and use explicit spot-to-future alias mapping during resolver fallback lookups. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,7 @@ func (ms *MarketData) refreshFuturePairCache() error {
|
||||
if token == "" {
|
||||
continue
|
||||
}
|
||||
token = normalizeFutureToken(token)
|
||||
token = futureCacheTokenKey(token)
|
||||
futureTokenCandidates[token] = append(futureTokenCandidates[token], s.Symbol)
|
||||
}
|
||||
|
||||
@@ -168,12 +168,8 @@ func selectCanonicalSymbolByQuotePriority(token string, candidates []string) str
|
||||
return normalized[0]
|
||||
}
|
||||
|
||||
func normalizeFutureToken(token string) string {
|
||||
token = strings.ToUpper(token)
|
||||
if mapped, ok := binance.FutureToken2SpotTokenMap[token]; ok {
|
||||
return strings.ToUpper(mapped)
|
||||
}
|
||||
return token
|
||||
func futureCacheTokenKey(token string) string {
|
||||
return strings.ToUpper(token)
|
||||
}
|
||||
|
||||
func (ms *MarketData) IsSpotPair(symbol string) bool {
|
||||
|
||||
Reference in New Issue
Block a user