python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

'APIError(code=-2011): Unknown order sent.' due to delay?

Open 6be6 opened this issue 3 years ago • 1 comments

Hi!

At first: Thx for this API!

Now, I have the following problem. An example: My bot made a limit_sell_order, which was fully executed at 14:39.00 according to order history at binance and als my bot. No partial filling! 2 seconds later, my bot restarted, checked for open orders (client.get_open_order()) and showed the order (print()) which just was executed...? And if client.get_open_order() is not empty, I do a market sell. But of course this produced the 'APIError(code=-2011): Unknown order sent.', because the order was already over, actually. In such an error case, my bot waits for 30 seconds, then restarts again. But it still got the order as open and made a second 'APIError(code=-2011): Unknown order sent.', at 14:39.36! The 3d time, client.get_open_order() was finally empty.

So can it be, that after an order is executed the client.get_open_order() has a quite big delay, like 30-40", until the order is cleared by calling get_open_order()? It can't be an issue of my connection or else because the client.get_asset_balance function shows this instantly when an order was executed.

Thx & Greets B

6be6 avatar Feb 20 '21 14:02 6be6

did you find a solution for this?

Karlheinzniebuhr avatar Jul 18 '22 18:07 Karlheinzniebuhr