New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ccxtpro bug: the watched ohlcvs cache in OKX exchange not updated #22228
Comments
Hello @eurekawild, What's the best way of reproducing the issue? Do we have to wait an hour? |
I dont have a best way. In my program, the same code for Binance is well. Maybe something is wrong in OKX, like the frequency limit etc. Now I restart my program per one hour, It's OK for me. |
This is the core code in my production environment. I just call the func watch_ohlcv() once, the func fetch_ohlcv() once. in the loop I just visit the ohlcv cache in ex. So I think it is not my code problem, and also not the question of the frequency limit. The code is simple and clear, but the ohlcvs stoped updating after the code runing an hour or two. So something is wrong in the func watch_ohlcv() in OKX exchange in my opinion. |
I can confirm the same. I am trying OKX watchOrderbook and it doesn't work but the same code for Bybit works. Version 4.3.11 Example code: watchOrderBooks(exchange, ["BTC-USDT-SWAP","ETH-USDT-SWAP"]) async function watchOrderBooks(exchange, perpSymbols) { If you run this code, the ETH-USDT-SWAP never console.logs. |
Also, when i am trying the same code without apikey i am getting okx requires "apiKey" credential. Does the OKX needs API keys for public orderbooks? By the way, it works on 4.1.11 version |
Hi @makarid , for the apiKey error you can set the params.depth to 'books' and that should fix it. I also opened a PR to default to it |
Hi @makarid , I believe I found the problem, I think your api keys don't have VIP4 permission to use the depth channel I opened one PR to default to the public channel and another to properly throw the error in this event. In the meantime the code should work if you use the depth channel |
Thank you very much @pcriadoperez ! |
Operating System
centos8
Programming Languages
Python
CCXT Version
4.2.100
Description
The cache of ohlcvs in OKX exchange are not updated after function watch_ohlcv() langched for a while(about 1 hour in my program), however the same code for Binance is well. I tried running it for several times and got the same fault in OKX and the right result in Binance.
Code
The text was updated successfully, but these errors were encountered: