ccxt: Missing updates while running watch_orders

Operating System

ubuntu 20.04

Programming Languages

Python

CCXT Version

4.0.81

Description

I am watching orders on kraken using watch_orders and occasionally there are some orders missing that get filled but watch_orders() doesn’t pick them up.

Here’s a sample sequence of events that took place where an update was missing. This isn’t a sequence that can be used to reproduce the problem.

  1. Started watch_orders(). All existing orders on the exchange were picked up and displayed.
  2. Placed a limit sell order and a limit buy order through rest api (separate code).
  3. watch_orders() displayed the orders placed in step 2.
  4. Limit buy order (placed in step 2 above) gets executed but watch_orders does not display the filled order.
  5. Limit sell order (placed in step 2 above) is canceled and watch_orders does display it.
  6. New sell order is created and watch_orders picks this up as well.

The code snippet for watch_orders() is below.

Is there something missing in this code that’s causing the missing updates? Would you recommend a different bit of code to avoid issues like these?

Code

async def watch_orders(exchange):
    while True:
        try:
            orders = await exchange.watch_orders()
            print('--------------------------------------------------------------')
            print('watch_orders():')
            pprint(orders)
        except Exception as e:
            print("Connection issue: \n", type(e).__name__, str(e))
            await exchange.close()
            continue

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 1
  • Comments: 22 (5 by maintainers)

Most upvoted comments

Let me get back to you on that @pcriadoperez, I’m certainly seeing more updates after setting new updates to False. Will update you once I see some orders processing and I can trace the updates.