bbgo/pkg/types/premiumindex.go

21 lines
605 B
Go
Raw Normal View History

package types
import (
"fmt"
"time"
"git.qtrade.icu/lychiyu/bbgo/pkg/fixedpoint"
)
type PremiumIndex struct {
Symbol string `json:"symbol"`
MarkPrice fixedpoint.Value `json:"markPrice"`
LastFundingRate fixedpoint.Value `json:"lastFundingRate"`
NextFundingTime time.Time `json:"nextFundingTime"`
Time time.Time `json:"time"`
}
func (i *PremiumIndex) String() string {
return fmt.Sprintf("PremiumIndex | %s | %.4f | %s | %s | NEXT FUNDING TIME: %s", i.Symbol, i.MarkPrice.Float64(), i.LastFundingRate.Percentage(), i.Time, i.NextFundingTime)
}