diff --git a/Trading/Exchange/binance/binance_exchange.py b/Trading/Exchange/binance/binance_exchange.py index 5297dc43f..0e6bc4ab3 100644 --- a/Trading/Exchange/binance/binance_exchange.py +++ b/Trading/Exchange/binance/binance_exchange.py @@ -102,13 +102,16 @@ def get_adapter_class(self): return BinanceCCXTAdapter async def get_account_id(self, **kwargs: dict) -> str: - raw_balance = await self.connector.client.fetch_balance() try: - return raw_balance[ccxt_constants.CCXT_INFO]["uid"] - except KeyError: if self.exchange_manager.is_future: - raise NotImplementedError("get_account_id is not implemented on binance futures account") - # should not happen in spot + raw_binance_balance = await self.connector.client.fapiPrivateV3GetBalance() + print(f"raw_binance_balance: {raw_binance_balance}") + return raw_binance_balance[0]["accountAlias"] + else: + raw_balance = await self.connector.client.fetch_balance() + return raw_balance[ccxt_constants.CCXT_INFO]["uid"] + except (KeyError, IndexError): + # should not happen raise def _infer_account_types(self, exchange_manager):