c7128ff516
1. Add GetAllPremiumIndex() to fetch all futures data in one call, used by GetTopPrices instead of per-symbol sequential calls. 2. Add ADMIN_CHAT_ID env check to /refresh command to restrict access to authorized users only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
22 lines
601 B
Go
22 lines
601 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)
|
|
|
|
// Trading pair methods
|
|
IsSpotPair(symbol string) bool
|
|
IsFuturesPair(symbol string) bool
|
|
RefreshTradingPairCache()
|
|
}
|