Skip to content

Kucoin Pro watchOrderBook #28595

@Tropmathise

Description

@Tropmathise

Operating System

Windows

Programming Language

Python

CCXT Version

4.5.53

Description

I have an error when trying to fetch the order book on Kucoin UTA when authenticated. It is working while not Authenticated and Non-UTA

import asyncio
import ccxt.pro as ccxtpro
import os
API_KEY = ""
API_SECRET = ""
PASSPHRASE = ""


async def main():
    exchange = ccxtpro.kucoin({
        'enableRateLimit': True,
        'apiKey': API_KEY,
        'secret': API_SECRET,
        'password': PASSPHRASE,
        "options": {
            'uta': True,
            'defaultType': 'swap',
        },
    })
    while True:
        try:
            symbol = 'SIRENUSDTM'

            ob = await exchange.watch_order_book(symbol, limit=5)

            print(ob)

        finally:
            await exchange.close()


asyncio.run(main())

Error :
\base\exchange.py", line 596, in load_order_book
index = self.get_cache_index(order_book, cache)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Python312\site-packages\ccxt\pro\kucoin.py", line 1599, in get_cache_index
if nonce < firstDeltaStart - 1:
~~~~~~~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions