Kraken WebSocket token 与 dead man's switch 订单控制雷达
本文正文暫以英文原文展示,翻譯版本需完成來源複核後再發布。
已验证事实边界
1. Kraken support documentation describes authenticated WebSocket trading through a token obtained from a REST token endpoint. 2. Kraken support documentation describes addOrder and cancelOrder messages over an authenticated WebSocket connection. 3. Kraken API key information documentation lists permissions including create-ws-token and order or trade permissions. 4. Kraken Futures documentation describes a dead man's switch endpoint that cancels orders after a timeout unless refreshed. 5. Kraken Futures trade history provides a separate surface for checking recent trade history. 6. A radar should separate token acquisition, WebSocket command acknowledgement, dead-man timeout, state query and evidence hygiene.
收起完整分析
决策矩阵
文章表格:可橫向滑動,或聚焦表格區域後使用方向鍵。
| Check | What it means | Practical action | Unknown to keep explicit |
|---|---|---|---|
| Token permission | WebSocket trading requires the correct API-key permission surface | verify create-ws-token and order permissions without exposing the key | whether an old key lacks the needed permission |
| Connection reuse | a private WebSocket session is intended to handle repeated order messages | reuse and monitor a stable authenticated connection | whether reconnect logic creates duplicate commands |
| Cancel acknowledgement | a cancel message acknowledgement is not the same as full portfolio reconciliation | store non-secret txid and cancel status only | whether an already-filled order was locally treated as cancelled |
| Dead-man timeout | the switch protects only when the refresh cadence is maintained | set timeout and refresh interval as explicit strategy parameters | whether network delay caused timer expiry or failed refresh |
| Fallback query | final state needs a separate query surface after anomalies | query trade or order history before resuming strategy | whether history retention or restart windows omit the event |
| Evidence hygiene | API logs can leak credentials or strategy timing | retain source URL, permission label, event id, time and stop rule | whether screenshots expose balances or positions |
来源地图
- Kraken Support:WebSocket API v1 - placing and cancelling orders(kraken-ws-trading)
- Kraken API Center:Get API Key Info(kraken-api-key-info)
- Kraken API Center:Dead man's switch(kraken-deadman-switch)
- Kraken API Center:Get trade history(kraken-futures-history)
控制说明
1. Token permission
这一项要求读者把公开来源翻译成操作规则。这里的含义是:WebSocket trading requires the correct API-key permission surface。可执行动作是:verify create-ws-token and order permissions without exposing the key。仍然未知的是:whether an old key lacks the needed permission。因此本文不会把未知部分包装成收益承诺、牌照承诺、审批保证、安全保证、恢复保证、平台排名或价格暗示。
2. Connection reuse
这里的含义是:a private WebSocket session is intended to handle repeated order messages。可执行动作是:reuse and monitor a stable authenticated connection。仍然未知的是:whether reconnect logic creates duplicate commands。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
3. Cancel acknowledgement
这里的含义是:a cancel message acknowledgement is not the same as full portfolio reconciliation。可执行动作是:store non-secret txid and cancel status only。仍然未知的是:whether an already-filled order was locally treated as cancelled。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
4. Dead-man timeout
这里的含义是:the switch protects only when the refresh cadence is maintained。可执行动作是:set timeout and refresh interval as explicit strategy parameters。仍然未知的是:whether network delay caused timer expiry or failed refresh。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
5. Fallback query
这里的含义是:final state needs a separate query surface after anomalies。可执行动作是:query trade or order history before resuming strategy。仍然未知的是:whether history retention or restart windows omit the event。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
6. Evidence hygiene
这里的含义是:API logs can leak credentials or strategy timing。可执行动作是:retain source URL, permission label, event id, time and stop rule。仍然未知的是:whether screenshots expose balances or positions。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
仍需明确的未知项
- whether an old key lacks the needed permission
- whether reconnect logic creates duplicate commands
- whether an already-filled order was locally treated as cancelled
- whether network delay caused timer expiry or failed refresh
- whether history retention or restart windows omit the event
- whether screenshots expose balances or positions
实用结论
Kraken 订单自动化应区分 WebSocket session control 与 dead man's switch protection。Kraken 支持文档说明 authenticated WebSocket trading 使用通过 GetWebSocketsToken 获取的 token,并且认证连接可以下单和撤单。Kraken Futures API 文档描述 cancel-all-orders-after endpoint 是 dead man's switch,需要持续刷新或显式关闭。本轮雷达结论是:在假设断线机器人安全前,先记录 token permission、connection reuse、cancel acknowledgement、timeout refresh cadence、fallback query 与不含秘密的证据。 本文停在证据边界内,帮助读者决定下一步核验什么,而不是把公开文档改写成私人账户、钱包、API key、池子路径、稳定币余额、代币化资产或政策框架在任何未来条件下都能成功的承诺。
相關專題與工具:交易所 API 與行情資料核查
來源與證據
04- WebSocket API v1 - placing and cancelling orders · support.kraken.com
- Get API Key Info · docs.kraken.com
- Dead man's switch · docs.kraken.com
- Get trade history · docs.kraken.com