qbtrade/pkg/types/premiumindex.go

21 lines
608 B
Go
Raw Normal View History

2024-06-27 14:42:38 +00:00
package types
import (
"fmt"
"time"
"git.qtrade.icu/lychiyu/qbtrade/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)
}