exchanges: Add UpdateTickers method and reserve UpdateTicker for single ticker symbol update requests (if supported) (#764)

* exchanges: add an UpdateTickers method to the main exchange interface

This method will fetch all currency pair tickers of a given asset type
and update them internally, does nothing for now.

* exchanges: refactor UpdateTicker on all exchanges

Keep the exact previous behaviour but implement the UpdateTickers
method and refactor UpdateTicker by using it where applicable.

* sync_manager: update all tickers when batching is enabled

* binance: UpdateTicker to fetch single ticker symbol

* ftx: UpdateTicker to fetch single ticker symbol
This commit is contained in:
Luis Rascão
2021-08-27 03:31:34 +01:00
committed by GitHub
parent 4851e94eba
commit c9ab0b1164
52 changed files with 931 additions and 267 deletions

View File

@@ -29,6 +29,7 @@ type IBotExchange interface {
ValidateCredentials(a asset.Item) error
FetchTicker(p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker(p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTickers(a asset.Item) error
FetchOrderbook(p currency.Pair, a asset.Item) (*orderbook.Base, error)
UpdateOrderbook(p currency.Pair, a asset.Item) (*orderbook.Base, error)
FetchTradablePairs(a asset.Item) ([]string, error)