Remove Alpha token price caching in spotPrice map
Build Docker Image / build (amd64) (push) Successful in 2m21s
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user