BTSE: Filter no liquidity pairs (#1182)

* BTSE: Filter no liquidity pairs

* thrasher: update commentary

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
Ryan O'Hara-Reid
2023-05-05 10:55:00 +10:00
committed by GitHub
parent e74461173c
commit f6fbe77f8c
2 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

@@ -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