711721c1ee
Build canonical spot/future token maps with quote priority, unify cache refresh scheduling, and switch resolver/token tests to map-based token lookups. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
25 lines
757 B
Go
25 lines
757 B
Go
package data
|
|
|
|
import "me.thuanle/bbot/internal/data/market"
|
|
|
|
type IMarket interface {
|
|
GetFuturePrice(symbol string) (float64, float64, int64, bool)
|
|
GetAllPremiumIndex() (map[string]market.PremiumIndex, error)
|
|
GetAllFundRate() (map[string]float64, map[string]int64)
|
|
|
|
GetSpotPrice(symbol string) (float64, bool)
|
|
GetMarginInterestRates() map[string]float64
|
|
|
|
// Alpha token methods
|
|
IsAlphaToken(symbol string) bool
|
|
GetAlphaToken(symbol string) (market.AlphaTokenInfo, bool)
|
|
GetAlphaPrice(symbol string) (float64, bool)
|
|
|
|
// Trading pair methods
|
|
IsSpotPair(symbol string) bool
|
|
IsFuturesPair(symbol string) bool
|
|
GetSpotSymbolByToken(token string) (string, bool)
|
|
GetFutureSymbolByToken(token string) (string, bool)
|
|
RefreshTradingPairCache() error
|
|
}
|