binance-spot-websocket-skill
Subscribe to Binance Spot public market streams through UXC raw WebSocket support for trades, book ticker, depth, and ticker events with stream-specific guardrails.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- binance-spot-websocket-skill
- description
- Subscribe to Binance Spot public market streams through UXC raw WebSocket support for trades, book ticker, depth, and ticker events with stream-specific guardrails.
02 资源文件 7
- 参考文档_meta.json147 B
- 参考文档agents/openai.yaml306 B
- 参考文档references/usage-patterns.md1.3 KB
- 脚本scripts/validate.sh1.9 KB
- 参考文档skill-card.md2.1 KB
- 参考文档SOURCE.md280 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Binance Spot WebSocket Skill
Use this skill to run Binance Spot public market streams 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 Binance Spot public WebSocket streams.
- A writable sink path for NDJSON output.
Scope
This skill covers Binance Spot public market streams such as:
- trade events
- aggregate trade events
- book ticker updates
- ticker updates
- depth updates
This skill does not cover:
- Binance Spot REST/OpenAPI workflows
- private user data streams
- signed WebSocket API methods
- margin, wallet, futures, or other non-Spot product families
Endpoint Model
Binance Spot public market streams use raw WebSocket endpoints.
- preferred base:
wss://stream.binance.com:443 - raw stream form:
wss://stream.binance.com:443/ws/<streamName> - combined stream form:
wss://stream.binance.com:443/stream?streams=<stream1>/<stream2>
Important:
- stream names are lowercase
- connections are valid for up to 24 hours
- raw stream payloads arrive directly as JSON objects
- combined stream payloads arrive as
{"stream":"...","data":{...}}
Core Workflow
- Start a subscription directly with
uxc subscribe start:uxc subscribe start wss://stream.binance.com:443/ws/btcusdt@trade --transport websocket --sink file:$HOME/.uxc/subscriptions/binance-btcusdt-trade.ndjson
- Inspect the sink output:
tail -n 5 $HOME/.uxc/subscriptions/binance-btcusdt-trade.ndjson
- Query runtime status:
uxc subscribe listuxc subscribe status <job_id>
- Stop the job when finished:
uxc subscribe stop <job_id>
Common Stream Targets
- raw trade stream:
btcusdt@trade
- aggregate trade stream:
btcusdt@aggTrade
- book ticker stream:
btcusdt@bookTicker
- mini ticker stream:
btcusdt@miniTicker
- rolling ticker stream:
btcusdt@ticker
- depth stream:
btcusdt@depth
Runtime Validation
The following live raw WebSocket flow was validated successfully through uxc:
- endpoint:
wss://stream.binance.com:443/ws/btcusdt@trade - transport:
--transport websocket - sink output:
open- repeated
dataevents with Binancetradepayloads closedafter stop
Observed event fields included:
e: "trade"s: "BTCUSDT"pqt
Guardrails
- Keep automation on the JSON output envelope; do not use
--text. - Parse stable event fields first:
event_kind,data,meta. - Use
wss://stream.binance.com:443as the default public stream host; it validated more reliably than:9443in recent runtime checks. - Stream names must be lowercase.
- This skill is read-only. Do not describe it as account, order, or signed WebSocket support.
- Combined streams are useful when one job should emit multiple markets into one sink, but downstream parsing must handle
streamwrappers. uxc subscribe start ... --transport websocketis the intended execution path for this skill;uxc linkis not the main interface because stream identity is encoded directly in the endpoint path.
References
- Usage patterns:
references/usage-patterns.md
- Binance Spot WebSocket Streams:
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.