Remove Alpha token price caching in spotPrice map
Build Docker Image / build (amd64) (push) Successful in 2m21s

Alpha token prices are now looked up directly from Alpha data instead
of being cached into spotPrice. Remove unused ensureAlphaCacheLoaded
and shouldRefreshAlphaCache functions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 01:14:40 +07:00
parent 440fa3bacd
commit 87e69ec8d0
2 changed files with 13 additions and 45 deletions
+2 -7
View File
@@ -15,15 +15,10 @@ func (ms *MarketData) GetSpotPrice(symbol string) (float64, bool) {
return p, true
}
// If not found, check if it's an Alpha token and ensure cache is loaded
ms.ensureAlphaCacheLoaded()
// If not found, check if it's an Alpha token
if ms.IsAlphaToken(symbol) {
if alphaToken, exists := ms.GetAlphaToken(symbol); exists {
price := alphaToken.GetPrice()
if price > 0 {
ms.mu.Lock()
ms.spotPrice[symbol] = price
ms.mu.Unlock()
if price := alphaToken.GetPrice(); price > 0 {
return price, true
}
}