From f6fbe77f8cbf55e6502aa8da133d3712ca39b7eb Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Fri, 5 May 2023 10:55:00 +1000 Subject: [PATCH] BTSE: Filter no liquidity pairs (#1182) * BTSE: Filter no liquidity pairs * thrasher: update commentary --------- Co-authored-by: Ryan O'Hara-Reid --- exchanges/btse/btse_types.go | 2 ++ exchanges/btse/btse_wrapper.go | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/exchanges/btse/btse_types.go b/exchanges/btse/btse_types.go index d345881e..ad4a826b 100644 --- a/exchanges/btse/btse_types.go +++ b/exchanges/btse/btse_types.go @@ -55,6 +55,8 @@ type MarketSummary []struct { MaxRiskLimit int `json:"maxRiskLimit"` AvailableSettlement []string `json:"availableSettlement"` Futures bool `json:"futures"` + IsMarketOpenToSpot bool `json:"isMarketOpenToSpot"` + IsMarketOpentoOTC bool `json:"isMarketOpenToOtc"` } // OHLCV holds Open, High Low, Close, Volume data for set symbol diff --git a/exchanges/btse/btse_wrapper.go b/exchanges/btse/btse_wrapper.go index d19f6704..d2450241 100644 --- a/exchanges/btse/btse_wrapper.go +++ b/exchanges/btse/btse_wrapper.go @@ -248,7 +248,15 @@ func (b *BTSE) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.P } pairs := make([]currency.Pair, 0, len(m)) for x := range m { - if !m[x].Active { + if !m[x].Active || + // BTSE returns 0 for both highest bid and lowest ask if there is + // no order book data, so we skip those pairs. There is no way to + // take or provide liquidity for these pairs. + + // TODO: Add support for an OTC asset as this eliminates many valid + // tradable pairs which are active, OTC only and available on the + // front-end. + (m[x].LowestAsk == 0 && m[x].HighestBid == 0) { continue } var pair currency.Pair