Exchanges: Add config variable to set bypassing of orderbook verification by exchange (#614)

* Exchanges: Add config variable to set bypassing of orderbook verification

* Exchanges: Consolidate orderbook variables into config struct

* Exchanges: Addr nit; set verification bypass on websocket book implementations
This commit is contained in:
Ryan O'Hara-Reid
2021-01-06 12:56:30 +11:00
committed by GitHub
parent 010fab02ca
commit 7431bf8866
56 changed files with 291 additions and 128 deletions

View File

@@ -330,6 +330,7 @@ func (h *HitBTC) WsProcessOrderbookSnapshot(ob WsOrderbook) error {
newOrderBook.AssetType = asset.Spot
newOrderBook.Pair = p
newOrderBook.ExchangeName = h.Name
newOrderBook.VerificationBypass = h.OrderbookVerificationBypass
return h.Websocket.Orderbook.LoadSnapshot(&newOrderBook)
}

View File

@@ -165,8 +165,8 @@ func (h *HitBTC) Setup(exch *config.ExchangeConfig) error {
UnSubscriber: h.Unsubscribe,
GenerateSubscriptions: h.GenerateDefaultSubscriptions,
Features: &h.Features.Supports.WebsocketCapabilities,
OrderbookBufferLimit: exch.WebsocketOrderbookBufferLimit,
BufferEnabled: exch.WebsocketOrderbookBufferEnabled,
OrderbookBufferLimit: exch.OrderbookConfig.WebsocketBufferLimit,
BufferEnabled: exch.OrderbookConfig.WebsocketBufferEnabled,
SortBuffer: true,
SortBufferByUpdateIDs: true,
})
@@ -366,7 +366,12 @@ func (h *HitBTC) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbo
// UpdateOrderbook updates and returns the orderbook for a currency pair
func (h *HitBTC) UpdateOrderbook(c currency.Pair, assetType asset.Item) (*orderbook.Base, error) {
book := &orderbook.Base{ExchangeName: h.Name, Pair: c, AssetType: assetType}
book := &orderbook.Base{
ExchangeName: h.Name,
Pair: c,
AssetType: assetType,
VerificationBypass: h.OrderbookVerificationBypass,
}
fpair, err := h.FormatExchangeCurrency(c, assetType)
if err != nil {
return book, err