bybit

package module
v0.0.0-...-a05b099 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 20 Imported by: 0

README

Bybit Connector

Bybit

Established in March 2018, Bybit is one of the fastest growing cryptocurrency exchanges, with more than 2 million registered users. Built on customer-centric values, we endeavor to provide a professional, smart, intuitive and innovative online trading and cloud mining experience for retail and institutional clients around the world. Bybit is committed to creating a fair, transparent and efficient exchange environment, and offer 24/7 multi-lingual customer support to provide assistance in a timely manner.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BybitConnector

type BybitConnector struct {
	*connector.Connector
	exchange.Base
	// contains filtered or unexported fields
}

func (*BybitConnector) GetInstruments

func (b *BybitConnector) GetInstruments(params *GenericRequestParams) (time.Time, []Instrument, error)

func (*BybitConnector) SendHTTPRequest

func (b *BybitConnector) SendHTTPRequest(path string, params bitmex.Parameter, result interface{}) error

SendHTTPRequest sends an unauthenticated HTTP request

func (*BybitConnector) SetDefaults

func (b *BybitConnector) SetDefaults() error

SetDefaults sets the basic defaults for Bitmex

func (*BybitConnector) Start

func (c *BybitConnector) Start()

type Cache

type Cache map[string]UpdateData

func (*Cache) String

func (c *Cache) String() string

type GenericRequestParams

type GenericRequestParams struct {
	Symbol string
}

func (*GenericRequestParams) IsNil

func (p *GenericRequestParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*GenericRequestParams) ToURLVals

func (p *GenericRequestParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*GenericRequestParams) VerifyData

func (p *GenericRequestParams) VerifyData() error

VerifyData verifies outgoing data sets

type Instrument

type Instrument struct {
	Symbol               string  `json:"symbol"`
	BidPrice             string  `json:"bid_price"`
	AskPrice             string  `json:"ask_price"`
	LastPrice            string  `json:"last_price"`
	LastTickDirection    string  `json:"last_tick_direction"`
	PrevPrice24H         string  `json:"prev_price_24h"`
	Price24HPcnt         string  `json:"price_24h_pcnt"`
	HighPrice24H         string  `json:"high_price_24h"`
	LowPrice24H          string  `json:"low_price_24h"`
	PrevPrice1H          string  `json:"prev_price_1h"`
	Price1HPcnt          string  `json:"price_1h_pcnt"`
	MarkPrice            string  `json:"mark_price"`
	IndexPrice           string  `json:"index_price"`
	OpenInterest         float64 `json:"open_interest"`
	OpenValue            string  `json:"open_value"`
	TotalTurnover        string  `json:"total_turnover"`
	Turnover24H          string  `json:"turnover_24h"`
	TotalVolume          float64 `json:"total_volume"`
	Volume24H            float64 `json:"volume_24h"`
	FundingRate          string  `json:"funding_rate"`
	PredictedFundingRate string  `json:"predicted_funding_rate"`
	NextFundingTime      string  `json:"next_funding_time"`
	CountdownHour        int     `json:"countdown_hour"`
}

Note: WsInstrument is different

type ResultWrapper

type ResultWrapper struct {
	RetCode          int    `json:"ret_code"`
	RetMsg           string `json:"ret_msg"`
	ExtCode          string `json:"ext_code"`
	ExtInfo          string `json:"ext_info"`
	TimeNow          string `json:"time_now"`
	RateLimitStatus  int    `json:"rate_limit_status"`
	RateLimitResetMs int64  `json:"rate_limit_reset_ms"`
	RateLimit        int    `json:"rate_limit"`
}

type UpdateData

type UpdateData struct {
	LastUpdated  time.Time
	OpenInterest float64
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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