From 09007cbf0822cd7646d8b46a8578f27834fecd88 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 17 Jun 2023 16:06:17 -0400 Subject: [PATCH] Do native symbology lookup in order methods, send user oid in cancel requests --- piker/brokers/binance/api.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/piker/brokers/binance/api.py b/piker/brokers/binance/api.py index fc34ba29..15fd92ae 100644 --- a/piker/brokers/binance/api.py +++ b/piker/brokers/binance/api.py @@ -637,8 +637,10 @@ class Client: Submit a live limit order to ze binance. ''' + # lookup the binance-native symbol from search table + bs_mktid: str = self._pairs[symbol.upper()].symbol params: dict = OrderedDict([ - ('symbol', symbol.upper()), + ('symbol', bs_mktid), ('side', side.upper()), ('type', 'LIMIT'), ('timeInForce', tif), @@ -677,10 +679,11 @@ class Client: recv_window: int = 60000 ) -> None: - symbol = symbol.upper() + bs_mktid: str = self._pairs[symbol.upper()].symbol params = OrderedDict([ - ('symbol', symbol), - ('orderId', oid), + ('symbol', bs_mktid), + # ('orderId', oid), + ('origClientOrderId', oid), ('recvWindow', recv_window), ('timestamp', binance_timestamp(now())) ])