ccxt icon indicating copy to clipboard operation
ccxt copied to clipboard

CoinbasePro: watchOrderBook trigger frequency out of sync with exchange

Open xc5211 opened this issue 2 years ago • 2 comments

While cctx wiki says In real-time mode CCXT Pro will return the result as soon as each new delta arrives from the exchange., I've monitored that for CoinbasePro(not sure if other exchange having this issue or not), watchOrderBook would only be triggered after multiple batches of deltas arrive from the exchange. I'm wondering if this is expected or things need to be fixed here?

xc5211 avatar Dec 26 '22 04:12 xc5211

what language and what code are you using?

frosty00 avatar Dec 26 '22 05:12 frosty00

what language and what code are you using?

Python 3.8 and latest cctx code base.

The way that I watch order updates strictly follows the structure on wiki as below

async def main():
    exchange = ccxtpro.coinbasepro({'newUpdates': True})
    while True:
        orderbook = await exchange.watch_order_book('BTC/USD')
        print(1)
    await exchange.close()

run(main())

I also inserted printout(print(2)) right here. And once I start the program, instead of getting the output like 1 2 1 2 1 2 ..., I'm always getting more 2s than 1s like 1 2 2 2 1 2 1 2 2 2 1 2 1 2 2 1 ...

xc5211 avatar Dec 26 '22 17:12 xc5211

I confirmed this issue. @frosty00 , could this be due to the issue you mentioned of subscriptions getting overwritten when messages come in very fast?

pcriadoperez avatar Jan 26 '23 10:01 pcriadoperez