Documentation
¶
Index ¶
- Variables
- func FindLast(p currency.Pair, a asset.Item) (float64, error)
- func ProcessTicker(p *Price) error
- func SubscribeTicker(exchange string, p currency.Pair, a asset.Item) (dispatch.Pipe, error)
- func SubscribeToExchangeTickers(exchange string) (dispatch.Pipe, error)
- type Price
- type Service
- type Ticker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTickerNotFound = errors.New("no ticker found") ErrBidEqualsAsk = errors.New("bid equals ask this is a crossed or locked market") )
Public errors
Functions ¶
func ProcessTicker ¶
ProcessTicker processes incoming tickers, creating or updating the Tickers list
func SubscribeTicker ¶
SubscribeTicker subscribes to a ticker and returns a communication channel to stream new ticker updates
Types ¶
type Price ¶
type Price struct {
Last float64 `json:"Last"`
High float64 `json:"High"`
Low float64 `json:"Low"`
Bid float64 `json:"Bid"`
BidSize float64 `json:"BidSize"`
Ask float64 `json:"Ask"`
AskSize float64 `json:"AskSize"`
Volume float64 `json:"Volume"`
QuoteVolume float64 `json:"QuoteVolume"`
PriceATH float64 `json:"PriceATH"`
Open float64 `json:"Open"`
Close float64 `json:"Close"`
OpenInterest float64 `json:"OpenInterest"`
MarkPrice float64 `json:"MarkPrice"`
IndexPrice float64 `json:"IndexPrice"`
Pair currency.Pair `json:"Pair"`
ExchangeName string `json:"exchangeName"`
AssetType asset.Item `json:"assetType"`
LastUpdated time.Time
// Funding rate field variables
FlashReturnRate float64
BidPeriod float64
AskPeriod float64
FlashReturnRateAmount float64
}
Price struct stores the currency pair and pricing information
func GetExchangeTickers ¶
GetExchangeTickers returns all tickers for a given exchange
Click to show internal directories.
Click to hide internal directories.