Too aggressive API calls with hanging orders mode?

I’m running with hanging order mode on a Binance pair. It seems that my IP tends to get banned after are many outstanding / hanging orders:

2019-11-23 23:00:01,158 - 6604 - - WARNING - Failed to refresh the listen key ySqP8AMk2YCJRNHhMVhpQlYdfIdiNTlWTP1744cZ1ShYO06qNjTtCgsErKXu: {‘code’: -1003, ‘msg’: ‘Way too much request weight used; IP banned until 1574550960621. Please use the websocket for live updates to avoid bans.’}

While I haven’t checked the code, my suspicion is that the number of back-to-back API requests is proportional to the number of hanging orders, and that number hits Binance’s weight limit after a certain threshold?

If that’s the case, the bot should be sending the requests less aggressively, i.e. with some delay in between.

How many orders were hanging when your IP gets banned? Aside from the quantity, checking the duration of those orders could help us investigate the behavior. When you get the chance, can you also check the longest time an order was left hanging in Binance (i.e. from the time the order was opened until you get the IP ban error)?

Usually about ten orders and it starts happening after a few hours. It doesn’t seem to help even after I manually cancel some of the hanging orders.

Hmm… 10 orders are a lot compared to what I’ve experienced. I will run some tests to reproduce the behavior. Are you on multiple mode with hanging orders enabled?

No. I only used single order mode with hanging orders enabled.

Thanks. We’ll investigate and post updates related to this.