O

okx-dex-ws

by @okxv
4.4(3)

Consume DEX data in real-time via WebSocket, supporting CLI persistent monitoring and custom scripts, suitable for trading bots and on-chain analysis.

defiwebsocketreal-time-datatradingdexGitHub
Installation
npx skills add okx/onchainos-skills --skill okx-dex-ws
compare_arrows

Before / After Comparison

1
Before

Manually calling REST API to poll DEX data results in high latency and wasted request quotas, making it difficult to capture trading opportunities in real-time.

After

Receiving real-time DEX streaming data via WebSocket, with millisecond-level latency and no wasted API quotas.

SKILL.md

okx-dex-ws

Onchain OS DEX WebSocket — Unified Skill

Two ways to consume real-time DEX data:

  • CLI (onchainos ws) — start a background session, poll events incrementally. Best for monitoring and agent-driven workflows.

  • 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.

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

# 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": [...]}

Weekly Installs527Repositoryokx/onchainos-skillsGitHub Stars207First Seen13 days agoSecurity AuditsGen Agent Trust HubPassSocketPassSnykWarnInstalled onopencode516codex516github-copilot512cursor512gemini-cli511amp511

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs2.9K
Rating4.4 / 5.0
Version
Updated2026年5月23日
Comparisons1

User Rating

4.4(3)
5
67%
4
33%
3
0%
2
0%
1
0%

Rate this Skill

0.0

Compatible Platforms

🔧Claude Code

Timeline

Created2026年4月17日
Last Updated2026年5月23日