OKX Exchange WebSocket Skill for Openclaw

A high-performance skill for streaming real-time OKX exchange market data via WebSocket into structured NDJSON files.

jolestar
v1.0.0
Mar 16, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install okx-exchange-websocket-skill

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install okx-exchange-websocket-skill using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OKX Exchange WebSocket Skill?

The OKX Exchange WebSocket Skill provides a streamlined way to consume public market data from the OKX exchange. By utilizing the uxc utility, this skill allows developers to establish raw WebSocket connections to OKX public endpoints to receive live updates on tickers, trades, and order book events. It is a vital component of the Openclaw Skills ecosystem for users who need low-latency access to cryptocurrency market movements.

This skill is specifically designed for public exchange channels and handles the complexities of connection management and event-envelope parsing. By outputting data in NDJSON format, it ensures that market events are easily digestible by downstream analytics tools or databases without requiring custom client implementations.

OKX Exchange WebSocket Skill Use Cases

  • Tracking real-time price fluctuations for specific trading pairs like BTC-USDT.
  • Building local data lakes of historical trade events for backtesting and analysis.
  • Monitoring order book depth (books5) to gauge market liquidity.
  • Automated candlestick data collection for technical analysis signals.

How OKX Exchange WebSocket Skill Works

  1. The skill initiates a raw WebSocket connection to the OKX public endpoint (wss://ws.okx.com:8443/ws/v5/public) using uxc.
  2. A JSON-formatted subscribe frame is sent to the exchange to specify the desired channel and instrument ID.
  3. The skill manages the stream of incoming JSON payloads, ensuring they are captured and directed to a local sink.
  4. Users monitor the active subscription job via uxc status commands to ensure continuous data flow.

OKX Exchange WebSocket Skill Setup

Ensure that uxc is installed and accessible in your system PATH. You can start a subscription by providing the public endpoint and an initialization frame.

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

OKX Exchange WebSocket Skill Data Schema & Taxonomy

The skill produces NDJSON files where each line represents a discrete market event. The schema includes standard OKX fields wrapped in a uxc event envelope.

Field Type Description
arg.channel String The OKX channel (e.g., tickers, trades, books5)
arg.instId String The instrument identifier (e.g., BTC-USDT)
data[0].last String The last traded price (for ticker events)
data[0].ts String The Unix timestamp of the event
event_kind String The uxc internal event classification (e.g., data)

OKX Exchange WebSocket Skill Advanced Features

  • Support for multiple channel subscriptions including candle1m, books5, and trades.
  • Full compatibility with uxc sink handling for flexible data routing to files or pipes.
  • Optimized for public channel multiplexing, reducing the need for multiple socket connections.
  • Integrated job management for starting, listing, and stopping long-running data collection tasks within Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*