0x2e2a683d…8b6asent to0xb9e80ce5…0028·#8,106,636·0x923347fd…485e31
Python websocket client with api subscription.Implement websocket client in python with api subscription to Websocket endpoint as specified
in below definition and save received messages to mysql database.
Websocket endpoint:
wss://www.bitmex.com/realtime?subscribe=trade
Channel: trade
Requirements:
- The assignment will be accepted if the client is not disconnectd and runs forever.
- Heartbeat has to be implemented
https://www.bitmex.com/app/wsAPI#Heartbeats
- In case client is disconnected it has to reconnect and has to report disconnect error to log.
- The mysql table definition has to be provided in DDL.
- The code has to be provided in python and work under version 3.6
Documentation for trade
https://www.bitmex.com/app/wsAPI#Subscriptions
Testing the data feed:
You can test subscription to undertand correctly using in chrome:
Install Simple websocket client.
In server location url: wss://www.bitmex.com/realtime?subscribe=trade
in request enter:
in Message log you will see the data arrive.
When saving to database the data, the only symbol has to be saved: XBTUSD