BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

latency issue from websocket python #517

Open LDN-Calling opened 2 years ago

LDN-Calling commented 2 years ago

receiving updates at inconsistent and large intervals from server.

{'timestamp': '2022-07-20T11:23:25.061Z', 'symbol': 'XBTUSD', 'bidSize': 41600, 'bidPrice': 23656.5, 'askPrice': 23657, 'askSize': 2800} {'timestamp': '2022-07-20T11:23:27.036Z', 'symbol': 'XBTUSD', 'bidSize': 29000, 'bidPrice': 23656.5, 'askPrice': 23657, 'askSize': 15300} {'timestamp': '2022-07-20T11:23:28.051Z', 'symbol': 'XBTUSD', 'bidSize': 46600, 'bidPrice': 23656.5, 'askPrice': 23657, 'askSize': 2800} {'timestamp': '2022-07-20T11:23:28.416Z', 'symbol': 'XBTUSD', 'bidSize': 41600, 'bidPrice': 23656.5, 'askPrice': 23657, 'askSize': 2800}

timestamp is server time.

this is the endpoint I am using -> "wss://ws.bitmex.com/realtime"

Is this normal?

Is there a low latency feed accessible?

byshing commented 2 years ago

You may pick the quoteBin1m for quote coming in consistent 1 minute interval? Sample data:

{"table":"quoteBin1m","action":"insert","data":[{"timestamp":"2022-08-25T02:17:00.000Z","symbol":"XBTUSD","bidSize":75100,"bidPrice":21539.5,"askPrice":21540,"askSize":226300}]}

if you're looking for instant update of price you may want to subscribe to other topics like instrument or trade instead?