From c9ab989352e79a3f849714fabbb1dd03f7265c40 Mon Sep 17 00:00:00 2001 From: monkipon <154270946+monkipon@users.noreply.github.com> Date: Fri, 9 Jan 2026 23:20:15 +0300 Subject: [PATCH] Add support for 'twapStates' subscription type --- hyperliquid/websocket_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hyperliquid/websocket_manager.py b/hyperliquid/websocket_manager.py index 4c73a688..d2c8836b 100644 --- a/hyperliquid/websocket_manager.py +++ b/hyperliquid/websocket_manager.py @@ -37,6 +37,8 @@ def subscription_to_identifier(subscription: Subscription) -> str: return f'activeAssetCtx:{subscription["coin"].lower()}' elif subscription["type"] == "activeAssetData": return f'activeAssetData:{subscription["coin"].lower()},{subscription["user"].lower()}' + elif subscription['type'] == "twapStates": + return f'twapStates:{subscription["user"].lower()}' def ws_msg_to_identifier(ws_msg: WsMsg) -> Optional[str]: @@ -72,6 +74,8 @@ def ws_msg_to_identifier(ws_msg: WsMsg) -> Optional[str]: return f'activeAssetCtx:{ws_msg["data"]["coin"].lower()}' elif ws_msg["channel"] == "activeAssetData": return f'activeAssetData:{ws_msg["data"]["coin"].lower()},{ws_msg["data"]["user"].lower()}' + elif ws_msg["channel"] == "twapStates": + return f'twapStates:{ws_msg["data"]["user"].lower()}' class WebsocketManager(threading.Thread):