okx-dex-ws

作者: okx

Use this skill when the user mentions 'onchainos ws', 'ws start', 'ws poll', 'ws stop', 'ws channels', 'ws session', 'ws channel-info', 'idle-timeout', 'idle timeout', 'WebSocket channels', 'WS频道', or asks about managing WebSocket sessions/会话管理. Also use when writing a custom WebSocket script/脚本/bot for real-time on-chain data. Covers: onchainos ws CLI commands (start/poll/stop/list/channels/channel-info), session lifecycle, idle-timeout configuration, and all 9 DEX WebSocket channels...

npx skills add https://github.com/okx/onchainos-skills --skill 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:

CommandWorkflowFile
ws start, ws poll, ws stopWallet 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

ChannelGroupPatternRequired Params
kol_smartmoney-tracker-activitysignalglobal(none)
address-tracker-activitysignalper-wallet--wallet-addresses
dex-market-new-signal-openapisignalper-chain--chain-index
pricemarketper-token--token-pair
dex-token-candle{period}marketper-token--token-pair
price-infotokenper-token--token-pair
tradestokenper-token--token-pair
dex-market-memepump-new-token-openapitrenchesper-chain--chain-index
dex-market-memepump-update-metrics-openapitrenchesper-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

# 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-signal-openapi --chain-index 1,501

# New meme token launches on Solana
onchainos ws start --channel dex-market-memepump-new-token-openapi --chain-index 501

# K-line 1-minute candles
onchainos ws start --channel dex-token-candle1m --token-pair 1:0xdac17f958d2ee523a2206206994597c13d831ec7

Poll Filters (tracker channels only)

When polling kol_smartmoney-tracker-activity or address-tracker-activity, these filters are available:

  • --min-quote-amount, --min-market-cap, --min-pnl
  • --trader (wallet address prefix match)
  • --tag (smart_money or kol)
  • --trade-type (buy or sell)
  • --since (ms timestamp)

Approach 2: Custom Script

When the user wants to build a custom WebSocket client with their own logic, read the corresponding protocol reference file:

Market Data (price & candlestick streams)

Read: ../okx-dex-market/references/ws-protocol.md

Channels: price, dex-token-candle{period}

Token Data (detailed token streams)

Read: ../okx-dex-token/references/ws-protocol.md

Channels: price-info, trades

Signal & Wallet Tracking

Read: ../okx-dex-signal/references/ws-protocol.md

Channels: dex-market-new-signal-openapi, kol_smartmoney-tracker-activity, address-tracker-activity

Meme/Trenches

Read: ../okx-dex-trenches/references/ws-protocol.md

Channels: dex-market-memepump-new-token-openapi, dex-market-memepump-update-metrics-openapi

Common Protocol (all channels share)

  • Endpoint: wss://wsdex.okx.com/ws/v6/dex
  • Auth: HMAC-SHA256 login required before subscribing
  • Heartbeat: send "ping" every 25s, expect "pong"
  • Subscribe: {"op": "subscribe", "args": [...]}
  • Unsubscribe: {"op": "unsubscribe", "args": [...]}

來自 okx 的更多技能

okx-agent-identity
okx
ERC-8004 on-chain Agent identity on XLayer: register / create / update / activate / deactivate / search agents; view ratings; list agent services; set avatar. Roles: user (User / User Agent / Buyer / Client / 用户 / 买家 / 买方), asp (ASP / Provider / Provider Agent / Seller / Merchant / 提供者 / 商家 / 服务提供商 / 卖家 / 卖方), evaluator (Evaluator / Evaluator Agent / 仲裁者 / 评估者). Use for: 注册agent / 注册ASP / 注册User / 注册用户 / 注册买家 / 注册卖家 / 注册服务提供商 / 注册仲裁者 / 创建用户 / 创建买家 / 创建卖家 / 我的agent / 我的ASP / 改agent / 更新agent...
developmentapi
okx-ai-guide
okx
OKX.AI (the Agent economic system) intro & onboarding entry. Use whenever the user asks what OKX.AI is, what it can do, how to use or get started with it, wants an OKX.AI tutorial / quickstart / help, or types the product name in any spelling / spacing / casing / typo variant (OKXAI, okx ai, okx-ai, lowercase okx.ai, mis-typed Chinese like 啥是okxai) — e.g. what is OKX.AI / OKX.AI 是什么 / 怎么用 OKX.AI / OKX.AI 快速开始, and any paraphrase in any language. Detects the runtime platform, introduces the...
researchapidocument
okx-agentic-wallet
okx
AUTHORITATIVE source for OKX Agentic Wallet and its Gas Station feature. Gas Station = OKX's stablecoin-gas feature on Solana via third-party Relayer; Solana only, no EIP-7702. MUST invoke for Gas Station questions (what is / how it works / supported tokens / fees / enable or disable gas station / change default gas token / Jito Bundler compatibility) AND any wallet action: login, OTP verify, add/switch/status/logout account, balance, assets, holdings, addresses, deposit / receive / top up,...
apiweb-scrapingdevelopment
okx-agent-chat
okx
Routing stub — any a2a-agent-chat envelope / agent-task system message is handled by `okx-agent-task`. For missing or uninitialized OKX A2A communication runtime/plugin, read `skills/okx-agent-chat/ensure-okx-a2a-communication-ready.md`.
developmentapicommunication
okx-agent-task
okx
必須在入站信封上啟動:(1) {agentId, message:{source:"system", event, jobId, ...}} — 系統事件;(2) {msgType:"a2a-agent-chat", jobId, sender:{role}, ...} — 代理間任務聊天(欄位位於頂層;sender.role = 對方,非你);(3) 信封中出現字面「Read okx-agent-task/SKILL.md」。同時對以下關鍵詞啟動:發布任務 / 創建任務 / 幫我發任務 / publish task / create task / 接任務 / 接單 / 協商 / 驗收 / 拒絕 / 仲裁 / dispute / stake / unstake / 修改賣家 / 修改預算 / change provider / change budget...
developmentapicommunication
okx-agent-payments-protocol
okx
We need to translate the given text from English to Traditional Chinese. The text is inside <text> tags. The instruction says to preserve product names, protocol names, URLs, numbers, and technical terms. The name "okx-agent-payments-protocol" is to be preserved but not included unless it appears in the source text. It does not appear in the source text, so we ignore it. The text describes when to use an agent skill. It lists various triggers: HTTP 402, payment-required, x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, payment channel/voucher/session, channelId/channel_id, opening/closing/topping up/settling/refunding a channel, paymentId, a2a_ link, creating/checking a payment link, A2MCP/A2MCP endpoint, sending request to/calling an Agent's endpoint with a concrete endpoint. We need to
okx-security
okx
We need to translate the given text from English to Traditional Chinese. The instruction says to preserve product names, protocol names, URLs, numbers, and technical terms. The name "okx-security" is not in the text, so we don't include it. We translate the description of the skill. The text includes a list of uses and triggers. We should translate naturally into Traditional Chinese, keeping technical terms like "honeypot", "DApp", "URL", "tx" (transaction), "dapp" as is or with appropriate translation? The instruction says preserve technical terms, so we can keep "honeypot", "DApp", "URL", "tx" as is, but "tx" might be expanded to "交易" in Chinese? However, "tx" is a common abbreviation in crypto, but to be safe, we can keep "tx" as is or translate to "交易"? The instruction says "preserve technical terms", so likely keep abbreviations. But in the trigger list, "scan this tx" - we can translate "tx" as
okx-task-watch
okx
监听任务进展 / 帮我盯着任务 / 任务有动静告诉我 / 历史消息 / 未读消息 / 未决策 / 待决策 / 继续监听 / task watch / user watch / monitor task progress / catch me up on tasks / outstanding decisions — OKX A2A user-session task-notification monitor: live long-poll via `okx-a2a user watch` (also drains backlog of past/missed/unread events on entry) plus un-replied decision_request lister via `okx-a2a user outdated-list`. Not for wallet / gas / task-list / status queries.
developmentapiproductivity