Skip to content

Add WsBbo #142

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

Merged
merged 4 commits into from
May 14, 2025
Merged

Add WsBbo #142

merged 4 commits into from
May 14, 2025

Conversation

BriungRi
Copy link
Contributor

@BriungRi BriungRi commented Apr 19, 2025

Summary

Adding new WS based on the types from the docs

Test Plan

$ python examples/basic_ws.py 
Running with account address: [redacted]
{'channel': 'bbo', 'data': {'coin': 'ETH', 'time': 1746364055109, 'bbo': [{'px': '1831.8', 'sz': '32.2471', 'n': 4}, {'px': '1831.9', 'sz': '229.0857', 'n': 24}]}}
{'channel': 'bbo', 'data': {'coin': 'ETH', 'time': 1746364055581, 'bbo': [{'px': '1831.8', 'sz': '92.3172', 'n': 5}, {'px': '1831.9', 'sz': '229.0857', 'n': 24}]}}
{'channel': 'bbo', 'data': {'coin': 'ETH', 'time': 1746364055739, 'bbo': [{'px': '1831.8', 'sz': '32.2471', 'n': 4}, {'px': '1831.9', 'sz': '283.6522', 'n': 25}]}}
{'channel': 'bbo', 'data': {'coin': 'ETH', 'time': 1746364056570, 'bbo': [{'px': '1831.8', 'sz': '92.3172', 'n': 5}, {'px': '1831.9', 'sz': '283.6522', 'n': 25}]}}
{'channel': 'bbo', 'data': {'coin': 'ETH', 'time': 1746364057455, 'bbo': [{'px': '1831.8', 'sz': '94.7748', 'n': 6}, {'px': '1831.9', 'sz': '283.6522', 'n': 25}]}}

Copy link
Contributor

@traderben traderben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to support bbo subscriptions you would need to also update websocket_manager to handle the subscription type. Would also be good to update basic_ws.py to include the new subscription

@BriungRi BriungRi marked this pull request as draft April 25, 2025 02:27
@BriungRi
Copy link
Contributor Author

Converting to draft. It doesn't look like the bbo topic gives anything yet. Maybe the docs are ahead of the implementation?

@traderben
Copy link
Contributor

Converting to draft. It doesn't look like the bbo topic gives anything yet. Maybe the docs are ahead of the implementation?

The docs are not ahead of the implementation. Subscribing to bbo should work

@BriungRi BriungRi marked this pull request as ready for review May 4, 2025 13:12
@BriungRi
Copy link
Contributor Author

BriungRi commented May 4, 2025

The docs are not ahead of the implementation. Subscribing to bbo should work

You're right, found the issues after turning on debug logging. Thanks for the tip!

Pushed fixes + tested locally with basic_ws.py

@BriungRi
Copy link
Contributor Author

@traderben following up here for another review when you get the chance.

@traderben traderben merged commit d822d01 into hyperliquid-dex:master May 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants