-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the new Websocket API #344
Comments
I will be adding support for this soon. My gate.io SDK is actually the first one to see an implementation of a WS API and I'm likely to bring the same design over to the bybit SDK (as well as my other SDKs for exchanges that have a WS API). So if you'd like to see how that can work in practice, take a look at the gate SDK. Some docs here: Also an example here where you can see a minimal implementation in action: It's a great time for feedback/concerns, if you'd like to influence how the final implementation will look/work, so if this is something you will use in future please do take a look and ideally try it out. |
I wouldn’t say it’s finished yet. Still cleaning up, readme updates, and a million sanity checks, stress tests, robustness tests, etc. However, if you’re interested or even slightly curious in working with Bybit’s WebSocket API (submitting orders over WS), here’s an early peek into how it’s going to work! If you’ve seen our newer Gate.io SDK and how the WS API is integrated there, it’s very similar and I plan on upgrading all my SDKs to support each exchange’s WS API this way, where available. There are essentially two ways you can use it.
Amazingly, the request parameters for the WS API follow the exact same structure as the corresponding REST API call. So if you wanted, you can just swap your await order submit call with the await sendWSAPIRequest(…new order…) and it works almost the same way (via WS instead, and the response is nested within an object). All the convenience and speed without any of the hassle (of working with WebSockets). Anyway, text aside, if you’re curious - take a look:
Once I’m happy with some of the remaining things to work through, I’ll likely release a beta version to npm before the major release. Would very much appreciate extra help in stress testing it, in the off chance anything slipped through the cracks. I’ll post another update here and in the Node.js Algo Traders community in Telegram. Feedback/thoughts/concerns are always welcome - now is the best time for it, before the next release is GA. |
Help test the latest generation of the Bybit SDK, currently in public beta, before the major release! More info here in the open PR: |
https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline
Note: as of Dec 2024, demo trading does not support the WS API: https://t.me/BybitAPI/280348
Testnet is supported though.
The text was updated successfully, but these errors were encountered: