Comments (9)
Hello @ssemeniuta,
Thanks for letting us know, we will take a look.
from ccxt.
@carlosmiei this issue might not be directly solvable , because of the frequency of incoming OB updates could be faster than the loop of await .watchOrderBook. so, the solution could be:
A) native ED subscriptions
or
B) handling exceptions in userland to ignore that message
or
C) saving incoming updates in cache (even if there are no clients in this.futures
at the given moment) and once the await loopo returns back and re-subscribes into this.futures
, then return the new data with respecting cached data
from ccxt.
@ttodua I'm not sure exactly how the frequency of incoming updates is related to the checksum validation.
from ccxt.
@ttodua I'm not sure exactly how the frequency of incoming updates is related to the checksum validation.
because the incoming hash (from exchange side) should match the hash of local orderbook, and if you miss some deltas to be integrated into the local orderbook, then you will end up in different orderbook data, therefore different hash
from ccxt.
@ttodua the orderbook is always updated regardless of the "user subscription", you can even call watch_order_book()
only once and the orderbook will be updated in the background
from ccxt.
yes, you're right, what I wanted to interpret is that during frequent updates in bitfinex (if i correctly recall it was bitfinex) on same millisecond I have seen multiple incoming updates, thus when calculating the checksum of current orderbook, it might be still missing the first delta (because the whole handleMessage>handleOrderbook
whole cycle can take more than 1 MS) thus, if on same MS there incomes two delta:
- A
- B
if B is followed by checksum validation, then A update might not be yet handled (thus missing during checksum).
I just theoretically assume this might be case, can't prove atm..
from ccxt.
@ttodua Thanks for the feedback. Do I understand correctly that your hypothesis is that book updates are too frequent to be fully processed by the script?
Atm I essentially do B) handling exceptions in userland to ignore that message
from your suggestion - I let one script finish, wait for 2-3 minutes, then start the script again. There are periods when my app works for ~2-3 hours without this exception which is fine for now.
from ccxt.
@ssemeniuta I don't think that's the root cause for this issue, in the meantime while we debug it can you please try to disable the checksum validation by doing exchange.options['checksum'] = False
?
from ccxt.
I've modified the above code to
import ccxt.pro
from asyncio import run
print('CCXT Pro version', ccxt.pro.__version__)
params = {"prec": "P0"}
limit = 100
async def main():
exchange = ccxt.pro.bitfinex2()
await exchange.load_markets()
exchange.verbose = False
exchange.options['checksum'] = False
symbol = 'AZERO/USDT'
while True:
try:
orderbook = await exchange.watch_order_book(symbol, limit=limit, params=params)
print(orderbook)
except Exception as e:
print(type(e).__name__, str(e))
break
await exchange.close()
run(main())
And the exception did not appear after ~24 hours of runtime. Thank you.
from ccxt.
Related Issues (20)
- i'm try to do a code, it use ccxt to create a bot trading in ftx, but it occur (Exception has occurred: AttributeError module 'ccxt' has no attribute 'ftx'. AttributeError: module 'ccxt' has no attribute 'ftx'). What shuold i do? . My code:exchange = ccxt.ftx({ "apiKey": secret.PUBLIC_KEY, "secret": secret.SECRET_KEY }) HOT 1
- error in ccxt HOT 1
- error when import talib HOT 1
- C# Bitstamp CreateOrder Content-Type header is not accepted + wrong nonce generation HOT 4
- Bitget order subscription duplication. C# HOT 3
- How to make BBO orders in Binance? Sell & Buy HOT 3
- Bitget some of subscription are misssed. C# HOT 7
- race condition during auth HOT 4
- [Typescript] Not all types are being exported HOT 4
- BitMEX - watch_order_book error once a day - safe_string default value NoneType and operation of return is to append a string HOT 2
- Order side invalid error on Kucoin HOT 3
- C# WatchOrders Hyperliquid Subscriptions HOT 7
- coinbase advanced; fetch_accounts_v3 pagination doesn't work HOT 6
- [Bug][fetchTransfers] Binance - fetchTransfers seems to return only transfers from the Spot account to the Linear (Margin) account but not the other way around HOT 4
- error in ECS(VPS):ccxt.base.errors.ExchangeNotAvailable: binance GET https://api.binance.com/api/v3/exchangeInfo HOT 1
- Inconsistent Ticker Data for Bybit linear futures via websockets HOT 5
- Issue with ArrayCacheBySymbolBySide in watch_positions HOT 2
- Please list www.snipeEX.com
- Hyperliquid: withdraw function is outdated and doesn't use the new withdraw3 schema HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccxt.