[BUG] OKX Perpetual - Continuous WebSocket account updates error loop in v2.14.0
Author: scualoskyyCreated Jun 14, 2026Updated Aug 31, 2026
Bug Description
When running Hummingbot v2.14.0 with OKX Perpetual connector in headless mode, the private WebSocket connection fails continuously with account updates errors, causing a loop that generates thousands of log entries.
Environment
- Hummingbot version: 2.14.0
- Exchange: OKX Perpetual (okx_perpetual)
- Strategy: Grid Strike v2 controller
- Position mode: One-Way (net_mode)
- Deployment: Docker on DigitalOcean (Frankfurt region)
- OS: Ubuntu 22.04
Error Log
OkxPerpetualDerivative - Unexpected error while fetching account updates. (See log file for stack trace dump)
OkxPerpetualDerivative - Could not fetch account updates from Okx_perpetual. Check API key and network connection.
OkxPerpetualDerivative - Unexpected error in user stream listener loop. (See log file for stack trace dump)
OkxPerpetualUserStreamDataSource - Unexpected error while listening to user stream wss://ws.okx.com:8443/ws/v5/private. Retrying after 5 seconds...
OkxPerpetualUserStreamDataSource - Subscribed to private account and orders channels wss://ws.okx.com:8443/ws/v5/private...This cycle repeats every ~35 seconds indefinitely.
Impact
- The bot continues to place and manage orders correctly — grid levels are created and orders are submitted to OKX successfully.
- However, fill detection relies on the WebSocket feed. With the stream failing, the bot may delay recognizing filled orders, affecting grid rebalancing speed.
- Log files grow extremely fast due to the error loop.
Steps to Reproduce
- Configure
okx_perpetualconnector with valid API credentials - Set account to One-Way (net_mode) position mode on OKX
- Run Grid Strike v2 controller strategy in headless mode
- Observe continuous WebSocket reconnection loop in logs
Expected Behavior
Private WebSocket should maintain a stable connection to wss://ws.okx.com:8443/ws/v5/private and stream account/order updates without interruption.
Additional Notes
- API credentials are valid and working (REST API calls succeed normally)
- The issue persists after container restart and credential re-encryption
- Previously occurred in Hedge mode as well (
Parameter posSide errorwas a separate related issue when account was in Hedge mode)
Possible Cause
The OKX private WebSocket may require specific subscription parameters or authentication flow that differs from the current implementation in OkxPerpetualUserStreamDataSource.
Source: hummingbot/hummingbot