BingX fetch_balance() take more then 10 seconds
Operating System
Ubuntu 22.04.2 LTS
Programming Languages
Python
CCXT Version
4.3.1
Description
execution of the fetch_balance method takes a very long time (more than 10 seconds)
Code
client = ccxt.bingx({
'apiKey': api_key,
'secret': api_secret,
'timeout': 60000
})
try:
balance = client.fetch_balance()
result = Decimal(balance['USDT']['total'])
except Exception as ex:
result = Decimal('-1')
Hello @alex37529, most of the time is used to load markets (that is only done once).
You can pre-load them by doing exchange.load_markets() before calling fetch_balance
@carlosmiei it would be better if it was possible to get a balance without
exchange.load_markets()
This is why it is often necessary to quickly just get a balance without additional steps. Because I had to separately implement the quick balance retrieval separately
@alex37529 load_markets is needed because loads all the currencies/markets/precisions/etc, but you can load the markets immediately after instantiating the exchange so that when you need to call fetch_balance/any other unified method, the cache is warm and you don't have to wait.
Which return spot balance in new update for bingx fetchbalance() not work after update It is return only funds account balance?
@waelalahmar This issue targets a different issue, can you open a new one plz?
Thank you, I will open a new issue for that.