ccxws
ccxws copied to clipboard
Add exchange bybit
Integrate the bybit exchange
Exchange URL https://www.bybit.com/
Exchange API URL https://bybit-exchange.github.io/docs/inverse/
Additional information about Websocket connection https://bybit-exchange.github.io/docs/inverse/#t-websocket
Refer to Contributing Guide for additional information.
Thanks for the suggestion.
Notes for implementation perspective:
-
BasicClient
will work. It supports subscribing to multiple topics from a single socket. - Subscription format takes the form:
ws.send('{"op":"subscribe","args":["trade.BTCUSD|XRPUSD"]}')
where each market is concatenated - The use of semaphore is likely not required, it supports a "subscribe all" functionality and has a limited number of markets.
- Heartbeats are recommended every 30s -
ws.send('{"op":"ping"}');
- Subscription responses are provided for each subscribed topic
The following relevant APIs are supported:
- Ticker - https://bybit-exchange.github.io/docs/inverse/#t-websocketinstrumentinfo
- Trades - https://bybit-exchange.github.io/docs/inverse/#t-websockettrade
- L2Updates (with initial L2Snapshot) - https://bybit-exchange.github.io/docs/inverse/#t-websocketorderbook200
- Candles - https://bybit-exchange.github.io/docs/inverse/#t-websocketklinev2