Binance Spot API 限速、WebSocket 与订单控制清单
已验证事实边界
- Binance WebSocket API documentation says a single connection is valid for 24 hours and users should expect disconnection after that mark.
- Binance WebSocket API documentation says rate limit status can appear in the optional rateLimits field and includes REQUEST_WEIGHT and ORDERS limit types.
- Binance WebSocket API documentation says requests fail with status 429 when unfilled order count or request rate limits are violated.
- Binance WebSocket API documentation says repeated rate-limit violations can result in status 418 auto-bans.
- Binance unfilled-order-count documentation says successful new orders increment unfilled order count while rejected or unsuccessful orders are not guaranteed to do so.
收起完整分析
决策矩阵
文章表格:可横向滑动,或聚焦表格区域后使用方向键。
| 核对项 | 含义 | 具体做法 | 尚未确认的事项 |
|---|---|---|---|
| Connection lifetime | a WebSocket API session that should be renewed before or after the 24-hour window | schedule reconnects and preserve state before expiry | server-side maintenance timing |
| Ping and pong | heartbeat behavior that decides whether a connection remains live | reply promptly and monitor missed pongs | network jitter |
| REQUEST_WEIGHT | request budget across interval windows | record weight counts per bot and per IP | shared IP consumers |
| ORDERS | order-rate and unfilled-order pressure | separate order pacing from data polling | venue-side count recovery |
| 429 response | rate limit exceeded | back off and stop retry loops | partial state after timeout |
| 418 auto-ban | repeated violation consequence | treat as incident and halt bot traffic | ban duration |
| Request ID | correlation between request and response | use unique IDs for concurrent calls | duplicate replay confusion |
| 5xx timeout | execution status may be unknown | query order state before resubmitting | matching-engine outcome |
| API keys | HMAC, RSA or Ed25519 signing boundary | store keys outside content and logs | key-permission drift |
| Real-balance gate | when to allow production order flow | require dry-run evidence and kill switch | market stress behavior |
来源地图
- Binance Developer Docs:General WebSocket API Information(binance-ws-api)
- Binance Developer Docs:Spot Unfilled Order Count Rules(binance-order-count)
- Binance Developer Docs:Spot REST API(binance-rest-api)
- Binance:Terms of Use(binance-terms)
控制说明
1. Connection lifetime
这一项要求读者先把公开来源翻译成操作规则。这里的含义是:a WebSocket API session that should be renewed before or after the 24-hour window。可执行动作是:schedule reconnects and preserve state before expiry。仍然未知的是:server-side maintenance timing。因此本文不会把未知部分包装成安全承诺、收益承诺、官方背书、审批保证、可用性保证或注册诱导。
2. Ping and pong
这里的含义是:heartbeat behavior that decides whether a connection remains live。可执行动作是:reply promptly and monitor missed pongs。仍然未知的是:network jitter。
3. REQUEST_WEIGHT
这里的含义是:request budget across interval windows。可执行动作是:record weight counts per bot and per IP。仍然未知的是:shared IP consumers。
4. ORDERS
这里的含义是:order-rate and unfilled-order pressure。可执行动作是:separate order pacing from data polling。仍然未知的是:venue-side count recovery。
5. 429 response
这里的含义是:rate limit exceeded。可执行动作是:back off and stop retry loops。仍然未知的是:partial state after timeout。
6. 418 auto-ban
这里的含义是:repeated violation consequence。可执行动作是:treat as incident and halt bot traffic。仍然未知的是:ban duration。
7. Request ID
这里的含义是:correlation between request and response。可执行动作是:use unique IDs for concurrent calls。仍然未知的是:duplicate replay confusion。
8. 5xx timeout
这里的含义是:execution status may be unknown。可执行动作是:query order state before resubmitting。仍然未知的是:matching-engine outcome。
9. API keys
这里的含义是:HMAC, RSA or Ed25519 signing boundary。可执行动作是:store keys outside content and logs。仍然未知的是:key-permission drift。
10. Real-balance gate
这里的含义是:when to allow production order flow。可执行动作是:require dry-run evidence and kill switch。仍然未知的是:market stress behavior。
仍需明确的未知项
- server-side maintenance timing
- network jitter
- shared IP consumers
- venue-side count recovery
- partial state after timeout
- ban duration
- duplicate replay confusion
- matching-engine outcome
- key-permission drift
- market stress behavior
实用结论
本文最有价值的地方是克制。Binance Spot API 的集成风险不只是 API key 问题。Binance 开发者文档说明,WebSocket API 有 24 小时连接有效期、服务器 ping/pong、request id、可选 rateLimits 字段、多种限速周期、超出请求或未成交订单限制时的 429 响应,以及重复违反限速后的 418 自动封禁。未成交订单计数 FAQ 还说明,成功的新订单可能增加订单计数,而被拒绝或未成功订单不一定有相同影响。真正的操作决策是:在真实余额交易前,先跟踪 REQUEST_WEIGHT、ORDERS、连接生命周期和订单状态回查。 用户应获得一个更清楚的核验路径,而不是一个看似肯定、实则无法由公开证据承担的承诺。
来源与证据
04- 原文标题General WebSocket API Information · developers.binance.com
- 原文标题Spot Unfilled Order Count Rules · developers.binance.com
- 原文标题Spot REST API · developers.binance.com
- 原文标题Terms of Use
本文提到Binance、Drift。