nautilus_trader
nautilus_trader copied to clipboard
Binance HTTP request too often - then blocked
Bug Report
using the binance live, when start the tradingnode, too much rest request at the same time sent. the result is my ip is banned by binance. checking the source code. the problem as following: file: /home/jandy/Documents/opensource/nautilus_trader/nautilus_trader/adapters/binance/spot/execution.py
for symbol in active_symbols:
response = await self._http_account.get_orders(
symbol=symbol,
start_time=secs_to_millis(start.timestamp()) if start is not None else None,
end_time=secs_to_millis(end.timestamp()) if end is not None else None,
)
i have a lot of coins, different symbol. the above line sent a lof of rest request to binance. so my ip is banned. so i think the binancehttpclient should have a request limit. thanks.
Thanks for the report jandykwan
One limitation with the Binance API is they require you to pass the market
param for every different asset that needs to be reconciled, which can end up being many requests. Indeed some sort of rate limiting would solve this, there's currently an open issue and will be attended based on bandwidth https://github.com/nautechsystems/nautilus_trader/issues/547.
Closing this issue for now, as we finally have basic rate limiting for Binance.
Discussions and developments can be tracked here.