Comments (9)
thanks, I will keep an eye on this thread for any updates, in the meanwhile I will test with other exchanges
from ccxt.
Hello @jabranzahid-dev, Does that happen immediately? the duplicated values
from ccxt.
Hello @jabranzahid-dev, Does that happen immediately? the duplicated values
yes immediately. I mean the values do eventually change but after a while, so basically I am not getting prices in realtime, i.e. the frequency at which the values change depend on how many symbols I am subscribed to, for example, if I increase the symbols in the regions of 50-100, the values update every few seconds (for BTC/USDT I expect the values to change in every message right?), but I increase the symbols to 500, the values will change may be after 45 seconds BUT I will keep receiving new messages for every symbol. Hope I have explained correctly :)
from ccxt.
@jabranzahid-dev I was trying to debug this issue by running the snippet below, but although some messages have the same last price and some other common fields, I don't see duplicated timestamps (which would be a red flag)
cache = {}
markets = await exchange.load_markets(True)
# exchange.verbose = True
spot_markets = [market['symbol'] for market in markets.values() if market['spot']][:200]
while True:
tickers = await exchange.watch_tickers(spot_markets)
for ticker_symbol in tickers:
ticker = tickers[ticker_symbol]
if ticker_symbol not in cache:
cache[ticker_symbol] = ticker
else:
if ticker['last'] == cache[ticker['symbol']]['last']:
print('No change in price for', ticker['symbol'])
print('Timestamps:', ticker['timestamp'], cache[ticker['symbol']]['timestamp'])
if ticker['timestamp'] == cache[ticker['symbol']]['timestamp']:
print('No change in timestamp for', ticker['symbol'])
cache[ticker['symbol']] = ticker
from ccxt.
@jabranzahid-dev Actually after some time I got a duplicated timestamp as well but that was sent by the exchange in two different messages
2024-05-07T10:01:54.302Z message {"e":"24hrTicker","E":1715076113164,"s":"XVGETH","p":"0.00000000","P":"0.000","w":"0.00000173","x":"0.00000175","c":"0.00000174","Q":"2091.00000000","b":"0.00000173","B":"40395.00000000","a":"0.00000174","A":"65980.00000000","o":"0.00000174","h":"0.00000177","l":"0.00000170","v":"11705621.00000000","q":"20.27069206","O":1714989713163,"C":1715076113163,"F":11609979,"L":11611339,"n":1361}
2024-05-07T10:01:54.302Z message {"e":"24hrTicker","E":1715076113164,"s":"XVGETH","p":"0.00000000","P":"0.000","w":"0.00000173","x":"0.00000175","c":"0.00000174","Q":"2091.00000000","b":"0.00000173","B":"40395.00000000","a":"0.00000174","A":"65980.00000000","o":"0.00000174","h":"0.00000177","l":"0.00000170","v":"11705621.00000000","q":"20.27069206","O":1714989713163,"C":1715076113163,"F":11609979,"L":11611339,"n":1361}
from ccxt.
yes maybe if you subscribe to 1000 symbols, you will see duplicated messages straight away. So yes, the messages are coming in from the exchanges but with same content in them, do you think this is issue with exchange or ccxt is not able to handle that many messages coming in ? I tested this few months ago and it was fine back then and I recently picked this project(reinstalled ccxt) and facing this issue so I am not sure if something changed on the exchange end or with CCXT library
from ccxt.
@jabranzahid-dev I don't think this is an issue with ccxt, the exchange is sending those duplicated messages not ccxt. We will reach out to them to try to clarify this scenario.
from ccxt.
@jabranzahid-dev Yes I can confirm that the duplicated timestamps come from the exchange directly, as you can see using this snippet that just uses the raw websockets
package:
Nonetheless, the messages are not 100% equal, some of the fields like A
are different even though the timestamp is the same.
from ccxt.
Hi, Sorry it was an error in my code, I was subscribing to too many symbols too many times (incorrect exchange/symbol loops) so I think there is no issue. Sorry for inconvenience. Closing the issue. Regards
from ccxt.
Related Issues (20)
- Can't not fetch leverage with binace HOT 5
- Biance watch_ticker response value is None HOT 11
- Binance Portfolio Margin `timeInForce` option `PO` results in no TIF parameter in new order (UM) request HOT 7
- Bitget order subscription duplication. C# HOT 6
- Subscription does not receive any result. C# HOT 4
- Move event handler map from exchange.handle_message to an exchange instance variable HOT 3
- python ccxt fetch_ohlcv on kraken doesnt honor since parameter HOT 9
- Bitget error OHLCV for delivery futures HOT 5
- Coinbase trades pagination cursor HOT 9
- MEXC InvalidNonce HOT 1
- Bitget - increase speed limit on createOrder HOT 1
- add safetrade exchange
- New Exchange Request: BTCC
- CCXT.Pro watchOrders sending incorrect order events
- Bitmart error fetching tickers HOT 2
- Revert exchange name "Coinbase Advanced" back to "Coinbase" for backward compatibility... HOT 4
- kraken fetch_ohlcv since parameter broken HOT 3
- request poloniex private api show 400 Bad Request HOT 4
- Coinbase: Implementing fetch_trading_fees? HOT 5
- ccxt pro bingX watchTrades in swap market return empty list in python HOT 3
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.