OKX Exchange WebSocket Skill

Use this skill to run OKX public exchange WebSocket channels through uxc subscribe raw WebSocket mode.

Reuse the uxc skill for generic runtime behavior, sink handling, and event-envelope parsing.

Prerequisites

Scope

This skill covers OKX public exchange channels such as:

This skill does not cover:

Endpoint Model

Use the OKX public WebSocket endpoint:

OKX public channels require a subscribe frame after connect, for example:

{"op":"subscribe","args":[{"channel":"tickers","instId":"BTC-USDT"}]}

Core Workflow

  1. Start a raw WebSocket subscription:
    • uxc subscribe start wss://ws.okx.com:8443/ws/v5/public --transport websocket --init-frame '{"op":"subscribe","args":[{"channel":"tickers","instId":"BTC-USDT"}]}' --sink file:$HOME/.uxc/subscriptions/okx-btcusdt-ticker.ndjson
  2. Inspect sink output:
    • tail -n 5 $HOME/.uxc/subscriptions/okx-btcusdt-ticker.ndjson
  3. Query runtime status:
    • uxc subscribe list
    • uxc subscribe status <job_id>
  4. Stop the job when finished:
    • uxc subscribe stop <job_id>

Common Subscribe Frames

Runtime Validation

The following live raw WebSocket flow has been validated successfully through uxc:

Observed sink behavior:

Guardrails

References