From a4550afe90bf0d7b66a725f4bebc855999c2313d Mon Sep 17 00:00:00 2001 From: Nelson Torres Date: Tue, 21 May 2024 17:56:06 -0300 Subject: [PATCH 1/2] Added new fields to SpotPair class in venues --- piker/brokers/binance/venues.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/piker/brokers/binance/venues.py b/piker/brokers/binance/venues.py index 2529e520..dce0ea95 100644 --- a/piker/brokers/binance/venues.py +++ b/piker/brokers/binance/venues.py @@ -137,10 +137,12 @@ class SpotPair(Pair, frozen=True): quoteOrderQtyMarketAllowed: bool isSpotTradingAllowed: bool isMarginTradingAllowed: bool + otoAllowed: bool defaultSelfTradePreventionMode: str allowedSelfTradePreventionModes: list[str] permissions: list[str] + permissionSets: list[list[str]] # NOTE: see `.data._symcache.SymbologyCache.load()` for why ns_path: str = 'piker.brokers.binance:SpotPair' -- 2.34.1 From 31653277a42d9d191a579e98742fc51f91990d9e Mon Sep 17 00:00:00 2001 From: Nelson Torres Date: Wed, 22 May 2024 00:08:47 -0300 Subject: [PATCH 2/2] Added note to exception when missing field in SpotPair class --- piker/brokers/binance/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/brokers/binance/api.py b/piker/brokers/binance/api.py index 0055668d..616be6b3 100644 --- a/piker/brokers/binance/api.py +++ b/piker/brokers/binance/api.py @@ -433,7 +433,11 @@ class Client: item['filters'] = filters pair_type: Type = PAIRTYPES[venue] - pair: Pair = pair_type(**item) + try: + pair: Pair = pair_type(**item) + except Exception as e: + e.add_note(f'\nDon\'t panic, check out this https://binance-docs.github.io/apidocs/spot/en/#exchange-information') + raise pair_table[pair.symbol.upper()] = pair # update an additional top-level-cross-venue-table -- 2.34.1