26 lines
601 B
Go
26 lines
601 B
Go
package market
|
|
|
|
import "github.com/rs/zerolog/log"
|
|
|
|
type MarketData struct {
|
|
futureMarkPrice map[string]float64
|
|
futureFundingRate map[string]float64
|
|
futureNextFundingTime map[string]int64
|
|
|
|
spotPrice map[string]float64
|
|
}
|
|
|
|
func NewMarketData() *MarketData {
|
|
log.Info().Msg("Start market service")
|
|
ms := &MarketData{
|
|
futureMarkPrice: make(map[string]float64),
|
|
futureFundingRate: make(map[string]float64),
|
|
futureNextFundingTime: make(map[string]int64),
|
|
|
|
spotPrice: make(map[string]float64),
|
|
}
|
|
_ = ms.StartFutureWsMarkPrice()
|
|
_ = ms.StartSpotWsMarkPrice()
|
|
return ms
|
|
}
|