
Okx Dex Ws
Stream real-time OKX DEX on-chain data via onchainos ws sessions or custom WebSocket clients for bots and monitors.
Overview
okx-dex-ws is an agent skill for the Build phase that manages OKX DEX WebSocket sessions and documents all supported real-time on-chain channels.
Install
npx skills add https://github.com/okx/onchainos-skills --skill okx-dex-wsWhat is this skill?
- Two consumption modes: onchainos ws CLI (start, poll, stop, list, channels, channel-info) and custom Python/Node/Rust cl
- Nine DEX WebSocket channels: price, candle, trades, price-info, signals, tracker, meme scanning (per skill scope)
- Session management with idle-timeout configuration for long-running agent workflows
- Pre-flight via shared okx-agentic-wallet/_shared/preflight.md before live calls
- Cross-references ws-protocol.md from okx-dex-market, okx-dex-token, okx-dex-signal, okx-dex-trenches when installed
- Nine DEX WebSocket channel families documented in skill scope (price, candle, trades, price-info, signals, tracker, meme
- Skill metadata version 3.3.9 (MIT, OKX)
Adoption & trust: 3.3k installs on skills.sh; 284 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need live DEX prices, candles, trades, or signals in an agent or bot but lack a single guide for CLI sessions versus custom WebSocket code.
Who is it for?
Indie builders shipping crypto trading tools, alerts, or agent monitors on OKX on-chain data.
Skip if: Spot portfolio management without WebSockets, or workflows that refuse to install missing okx-dex-* companion skills when protocol files are required.
When should I use this skill?
User mentions onchainos ws, ws start/poll/stop, ws channels, ws session, idle-timeout, WebSocket channels, WS频道, or custom on-chain WebSocket scripts/bots.
What do I get? / Deliverables
You run or script a WebSocket session with the right channels, polling pattern, and idle-timeout settings aligned to Onchain OS pre-flight and sibling skill protocols.
- Running ws session with chosen channels
- Custom WebSocket client or polling workflow
Recommended Skills
Journey fit
Build-phase integration work: wiring live chain/DEX feeds into agents, scripts, or services. WebSocket session lifecycle and channel subscriptions are external system hooks—not ship-time QA or launch SEO.
How it compares
Integration skill for Onchain OS streaming—not a hosted MCP server and not REST-only market snapshots.
Common Questions / FAQ
Who is okx-dex-ws for?
Solo builders and small teams writing agents or bots that need OKX DEX WebSocket data via CLI or custom scripts.
When should I use okx-dex-ws?
During Build integrations when you mention ws start/poll/stop, session idle-timeout, channel-info, or building a real-time on-chain WebSocket client.
Is okx-dex-ws safe to install?
It implies network access and wallet-adjacent pre-flight; check the Security Audits panel on this Prism page and run pre-flight before live keys.
SKILL.md
READMESKILL.md - Okx Dex Ws
# Onchain OS DEX WebSocket — Unified Skill Two ways to consume real-time DEX data: 1. **CLI** (`onchainos ws`) — start a background session, poll events incrementally. Best for monitoring and agent-driven workflows. 2. **Script** — write a custom WebSocket client in Python/Node/Rust. Best for bots and custom logic. ## Pre-flight Checks > Read `../okx-agentic-wallet/_shared/preflight.md`. If that file does not exist, read `_shared/preflight.md` instead. ## Prerequisites This skill references `ws-protocol.md` files from `okx-dex-market`, `okx-dex-token`, `okx-dex-signal`, and `okx-dex-trenches`. If a referenced file is not found, the corresponding skill may not be installed — inform the user and suggest installing the missing skill from the onchainos-skills plugin. ## Related Workflows When one of the following commands is used, show the related workflow hint after displaying results: | Command | Workflow | File | |---------|----------|------| | `ws start`, `ws poll`, `ws stop` | Wallet Monitor (WebSocket) | `~/.onchainos/workflows/wallet-monitor-ws.md` | > Hint format: *"You can also try out our **Wallet Monitor (WebSocket)** workflow for more comprehensive results. Would you like to try it?"* ## Approach 1: CLI (`onchainos ws`) ### Discover Channels ``` onchainos ws channels # list all 9 supported channels onchainos ws channel-info --channel <name> # detailed info + example for a channel ``` ### Start / Poll / Stop ``` onchainos ws start --channel <channel> [params] # start background session onchainos ws poll --id <ID> [--channel <ch>] # pull new events onchainos ws list # list sessions onchainos ws stop [--id <ID>] # stop session(s) ``` ### Channel Quick Reference | Channel | Group | Pattern | Required Params | |---------|-------|---------|-----------------| | `kol_smartmoney-tracker-activity` | signal | global | (none) | | `address-tracker-activity` | signal | per-wallet | `--wallet-addresses` | | `dex-market-new-signal-openapi` | signal | per-chain | `--chain-index` | | `price` | market | per-token | `--token-pair` | | `dex-token-candle{period}` | market | per-token | `--token-pair` | | `price-info` | token | per-token | `--token-pair` | | `trades` | token | per-token | `--token-pair` | | `dex-market-memepump-new-token-openapi` | trenches | per-chain | `--chain-index` | | `dex-market-memepump-update-metrics-openapi` | trenches | per-chain | `--chain-index` | ### Parameter Formats - `--token-pair`: `chainIndex:tokenContractAddress` (e.g. `1:0xdac17f958d2ee523a2206206994597c13d831ec7`) - `--chain-index`: comma-separated chain IDs (e.g. `1,501,56`) - `--wallet-addresses`: comma-separated addresses, max 200 - `--idle-timeout`: auto-stop if no poll within this duration (default `30m`; `1h`, `2h`, `300s`, `0` to disable) ### Examples ```bash # Smart money trade feed onchainos ws start --channel kol_smartmoney-tracker-activity # Track specific wallets onchainos ws start --channel address-tracker-activity --wallet-addresses 0xAAA,0xBBB # Token price monitoring onchainos ws start --channel price --token-pair 1:0xdac17f958d2ee523a2206206994597c13d831ec7 # Buy signal alerts on Ethereum + Solana onchainos ws start --channel dex-market-new-signa