future

package
v0.5.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TickerTable = "futures/ticker"
)

Variables

This section is empty.

Functions

func FetchSymbolByIndex

func FetchSymbolByIndex(index string) []exchange.FuturesSymbol

func Init

func Init(ctx context.Context) error

Init start a background goroutine which used to update symbol map

func NewTickerChannel

func NewTickerChannel(symbol exchange.FuturesSymbol) exchange.Channel

func ParseSymbol

func ParseSymbol(symbol string) (exchange.FuturesSymbol, error)

Types

type OkexSymbol

type OkexSymbol struct {
	InstrumentID        string          `json:"instrument_id"`
	UnderlyingIndex     string          `json:"underlying_index"`
	QuoteCurrency       string          `json:"quote_currency"`
	TickSize            decimal.Decimal `json:"tick_size"`
	ContractVal         decimal.Decimal `json:"contract_val"`
	Listing             string          `json:"listing"`
	Delivery            string          `json:"delivery"`
	TradeIncrement      decimal.Decimal `json:"trade_increment"`
	Alias               string          `json:"alias"`
	Underlying          string          `json:"underlying"`
	BaseCurrency        string          `json:"base_currency"`
	SettlementCurrency  string          `json:"settlement_currency"`
	IsInverse           string          `json:"is_inverse"`
	ContractValCurrency string          `json:"contract_val_currency"`
	Category            string          `json:"category"`
}

func (*OkexSymbol) Parse

func (os *OkexSymbol) Parse() (*Symbol, error)

type RestClient

type RestClient struct {
	*okex.RestClient
}

func NewRestClient

func NewRestClient(key, secret, password string) *RestClient

func (*RestClient) RawSymbols

func (rc *RestClient) RawSymbols(ctx context.Context) ([]OkexSymbol, error)

RawSymbols return okex future symbols

func (*RestClient) Symbols

func (rc *RestClient) Symbols(ctx context.Context) ([]exchange.FuturesSymbol, error)

type Symbol

type Symbol struct {
	*exchange.BaseFutureSymbol
}

func (*Symbol) String

func (s *Symbol) String() string

type Ticker

type Ticker struct {
	Symbol         exchange.FuturesSymbol
	Last           decimal.Decimal
	LastQty        decimal.Decimal
	BestBid        decimal.Decimal
	BestBidSize    decimal.Decimal
	BestAsk        decimal.Decimal
	BestAskSize    decimal.Decimal
	Open24H        decimal.Decimal
	High24H        decimal.Decimal
	Low24H         decimal.Decimal
	Volume24H      decimal.Decimal
	VolumeToken24H decimal.Decimal
	OpenInterest   decimal.Decimal
	Time           time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL