Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Exchanges map[string]dia.Exchange
Functions ¶
This section is empty.
Types ¶
type AllOKExOptionsScrapers ¶
type AllOKExOptionsScrapers struct { Scrapers []*OKExOptionsScraper Markets []string // contains filtered or unexported fields }
func (*AllOKExOptionsScrapers) GetAndStoreOptionsMeta ¶
func (s *AllOKExOptionsScrapers) GetAndStoreOptionsMeta() (err error)
func (*AllOKExOptionsScrapers) MetaOnOptionIsAvailable ¶
func (s *AllOKExOptionsScrapers) MetaOnOptionIsAvailable(option OKExInstrument) (available bool, err error)
type OKExInstrument ¶
type OKExInstrument struct { InstrumentName string `json:"instrument_id"` Underlying string `json:"underlying"` SettlementCurrency string `json:"settlement_currency"` MinTradeAmount string `json:"contract_val"` OptionType string `json:"option_type"` Strike string `json:"strike"` TickSize string `json:"tick_size"` LotSize string `json:"lot_size"` Listing string `json:"listing"` Expiration string `json:"delivery"` State string `json:"state"` TradingStartTimestamp string `json:"trading_start_time"` }
type OKExInstrumentDetail ¶
type OKExInstrumentDetail struct { Category string `json:"category"` ContractVal string `json:"contract_val"` Delivery time.Time `json:"delivery"` InstrumentID string `json:"instrument_id"` Listing time.Time `json:"listing"` LotSize string `json:"lot_size"` OptionType string `json:"option_type"` SettlementCurrency string `json:"settlement_currency"` State string `json:"state"` Strike string `json:"strike"` TickSize string `json:"tick_size"` Timestamp time.Time `json:"timestamp"` TradingStartTime time.Time `json:"trading_start_time"` Underlying string `json:"underlying"` }
type OKExInstrumentDetails ¶
type OKExInstrumentDetails []OKExInstrumentDetail
type OKExInstruments ¶
type OKExInstruments struct {
Result []OKExInstrument `json:"result"`
}
type OKExOptionState ¶
type OKExOptionState int
const ( PreOpen OKExOptionState = iota + 1 Live Suspended Settlement )
type OKExOptionsScraper ¶
type OKExOptionsScraper struct { Markets []string // OKEx Options endpoint is a REST one and you are limited to 20 requests per 2 seconds. So you have // to throttle your polling frequency. This is in seconds. So you can have at most 10 // markets running at the same time on the same ip address PollFrequency int8 ScraperIsRunning bool ScraperIsRunningMu sync.Mutex // optionsWaitGroup *sync.WaitGroup DataStore *models.DB Ratelimiter *rate.Limiter // contains filtered or unexported fields }
func NewOKExOptionsScraper ¶
func NewOKExOptionsScraper(pollFreq int8) *OKExOptionsScraper
func (*OKExOptionsScraper) Channel ¶
func (s *OKExOptionsScraper) Channel() chan *dia.OptionOrderbookDatum
func (*OKExOptionsScraper) FetchInstruments ¶
func (s *OKExOptionsScraper) FetchInstruments()
func (*OKExOptionsScraper) Scrape ¶
func (s *OKExOptionsScraper) Scrape()
func (*OKExOptionsScraper) ScrapeInstrument ¶
func (s *OKExOptionsScraper) ScrapeInstrument(market string)
type OptionsScraper ¶
type OptionsScraper interface { //io.Closer FetchInstruments() Scrape() // Channel returns a channel that can be used to receive trades Channel() chan *dia.OptionOrderbookDatum }
OptionsScraper provides common methods needed to get Option orderBook information from
exchange APIs.
Click to show internal directories.
Click to hide internal directories.