From 35cb538a69ed0873fc39fdd3cb43618db2675000 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 24 Apr 2025 10:37:52 -0400 Subject: [PATCH] Update `binance` spot pairs with `amendAllowed` As per API updates, https://developers.binance.com/docs/binance-spot-api-docs https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority I also slightly tweaked the filed mismatch exception note to include the `repr(pair_type)` so the dev can know which pair types should be changed. --- piker/brokers/binance/api.py | 11 ++++++++--- piker/brokers/binance/venues.py | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/piker/brokers/binance/api.py b/piker/brokers/binance/api.py index f163162e..78be9ef8 100644 --- a/piker/brokers/binance/api.py +++ b/piker/brokers/binance/api.py @@ -374,9 +374,14 @@ class Client: pair: Pair = pair_type(**item) except Exception as e: e.add_note( - "\nDon't panic, prolly stupid binance changed their symbology schema again..\n" - 'Check out their API docs here:\n\n' - 'https://binance-docs.github.io/apidocs/spot/en/#exchange-information' + f'\n' + f'New or removed field we need to codify!\n' + f'pair-type: {pair_type!r}\n' + f'\n' + f"Don't panic, prolly stupid binance changed their symbology schema again..\n" + f'Check out their API docs here:\n' + f'\n' + f'https://binance-docs.github.io/apidocs/spot/en/#exchange-information\n' ) raise pair_table[pair.symbol.upper()] = pair diff --git a/piker/brokers/binance/venues.py b/piker/brokers/binance/venues.py index 2c025fe1..fdcb5f12 100644 --- a/piker/brokers/binance/venues.py +++ b/piker/brokers/binance/venues.py @@ -144,6 +144,11 @@ class SpotPair(Pair, frozen=True): permissions: list[str] permissionSets: list[list[str]] + # can the paint botz creat liq gaps even easier on this asset? + # Bp + # https://developers.binance.com/docs/binance-spot-api-docs/faqs/order_amend_keep_priority + amendAllowed: bool + # NOTE: see `.data._symcache.SymbologyCache.load()` for why ns_path: str = 'piker.brokers.binance:SpotPair'