OKX Exchange WebSocket Skill
Subscribe to OKX public exchange WebSocket channels through UXC raw WebSocket mode for ticker, trade, book, and candle events with explicit subscribe frames.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 28 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The SKILL.md, usage examples, and validate script all show the skill's sole purpose is subscribing to OKX public WS channels via 'uxc subscribe'. That purpose matches the code and examples. However, the registry metadata lists no required binaries while the runtime prerequisites and validation script require 'uxc' to be on PATH and 'rg' (ripgrep) for validation. The dependency on the 'uxc' tool is reasonable for the skill's purpose but should be declared.
Instruction Scope
Instructions are narrowly scoped to public OKX WebSocket channels, using explicit subscribe frames and writing NDJSON to a local sink. The SKILL.md explicitly excludes private/login/trading flows and warns not to mix auth flows. It only references local sink paths and the OKX public endpoint; it does not instruct reading arbitrary local files or exfiltrating secrets.
Install Mechanism
There is no install spec (instruction-only), so nothing is downloaded or written by the skill itself. The included validate.sh is a local check script and does not fetch external code. This is a low-risk install footprint.
Credentials
The skill requests no environment variables or credentials, and public OKX channels do not require login. The only runtime requirements are network access to wss://ws.okx.com and a writable sink path; these are proportionate to the stated purpose.
Persistence & Privilege
The skill does not request persistent/autonomous privileges beyond the normal model-invocation default. always is false. It writes its subscription output to a local NDJSON sink (user home under .uxc), which is expected behavior for a streaming subscription skill.
Assessment
This skill appears to do what it says: start OKX public WebSocket subscriptions using the 'uxc' tool and write NDJSON to a local sink. Before installing, verify you have a trusted 'uxc' binary (or the 'uxc' skill) available and that you are comfortable with the skill writing subscription files under $HOME/.uxc/subscriptions. Note the repository's metadata does not declare required binaries: the runtime expects 'uxc' and the included validation script expects 'rg' (ripgrep). If you plan to run the validate script, ensure 'rg' is installed. Also avoid using this skill with private OKX credentials — it is explicitly for public channels only.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
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
uxcis installed and available inPATH.- Network access to the OKX public WebSocket endpoint.
- A writable sink path for NDJSON output.
Scope
This skill covers OKX public exchange channels such as:
- tickers
- trades
- books and books5
- candle channels
This skill does not cover:
- OKX OnchainOS MCP
- private WebSocket login flows
- trading, account, or order-management channels
- REST API workflows
Endpoint Model
Use the OKX public WebSocket endpoint:
wss://ws.okx.com:8443/ws/v5/public
OKX public channels require a subscribe frame after connect, for example:
{"op":"subscribe","args":[{"channel":"tickers","instId":"BTC-USDT"}]}
Core Workflow
- 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
- Inspect sink output:
tail -n 5 $HOME/.uxc/subscriptions/okx-btcusdt-ticker.ndjson
- Query runtime status:
uxc subscribe listuxc subscribe status <job_id>
- Stop the job when finished:
uxc subscribe stop <job_id>
Common Subscribe Frames
- tickers:
{"op":"subscribe","args":[{"channel":"tickers","instId":"BTC-USDT"}]}
- trades:
{"op":"subscribe","args":[{"channel":"trades","instId":"BTC-USDT"}]}
- books5:
{"op":"subscribe","args":[{"channel":"books5","instId":"BTC-USDT"}]}
- candles:
{"op":"subscribe","args":[{"channel":"candle1m","instId":"BTC-USDT"}]}
Runtime Validation
The following live raw WebSocket flow has been validated successfully through uxc:
- endpoint:
wss://ws.okx.com:8443/ws/v5/public - transport:
--transport websocket - init frame:
{"op":"subscribe","args":[{"channel":"tickers","instId":"BTC-USDT"}]}
Observed sink behavior:
- initial
open - JSON
dataevent for subscription acknowledgement - repeated
dataevents carrying ticker payloads under:arg.channelarg.instIddata[0].lastdata[0].bidPxdata[0].askPxdata[0].ts
Guardrails
- Keep automation on the JSON output envelope; do not use
--text. - Parse stable event fields first:
event_kind,data,meta. - Always pass
--transport websocketfor this skill. - Public OKX channels do not require login. Do not mix this skill with private WebSocket auth flows.
--init-frameis required because OKX public channels are multiplexed behind one endpoint.instIdvalues use OKX instrument naming such asBTC-USDT.uxc subscribe start ... --transport websocketis the intended execution path for this skill;uxc linkis not the main interface because channel selection lives in the subscribe frame.
References
- Usage patterns:
references/usage-patterns.md
- OKX WebSocket API:
Files
4 totalSelect a file
Select a file to preview.
Comments
Loading comments…
