加密交易所 Client Order ID 重试与对账雷达
已验证事实边界
1. Coinbase Exchange get-order documentation says an order can be queried by exchange-assigned id or client-assigned client_oid. 2. Coinbase Exchange cancel-order documentation says cancellation can use exchange id or client-assigned client_oid and describes cancel-reject behavior. 3. Kraken WebSocket v2 add_order documentation is an order-entry surface for creating orders over WebSocket. 4. OKX place-order documentation is a separate official order-entry surface with its own request and response semantics. 5. Bybit place-order documentation includes orderLinkId and other order-control fields. 6. A client order id does not prove final fill, settlement, cancellation, position state, private risk approval or support recovery.
收起完整分析
决策矩阵
文章表格:可横向滑动,或聚焦表格区域后使用方向键。
| Check | What it means | Practical action | Unknown to keep explicit |
|---|---|---|---|
| Client identity | client-supplied order identity helps correlate requests but is not the same as exchange final state | log the non-secret client id and exchange id separately | whether a lost request reached the matching engine |
| Acknowledgement layer | venue acknowledgement can arrive before final execution, rejection or cancellation is known | separate request accepted, order open, partially filled, filled, canceled and rejected states | network loss between acknowledgement and final state |
| Retry rule | retries can duplicate risk when client id reuse and final-state checks are unclear | require a lookup or cancel-reconcile route before repeating a mutating request | venue-specific idempotency windows and purged historical records |
| Cancel evidence | a cancel response or cancel reject needs its own evidence chain | record cancel request id, product or symbol, venue response and final state | orders already filled, already canceled or no longer queryable |
| Stop condition | automation should stop when it cannot prove whether an order exists or changed state | pause trading if client id, venue id, final state or reconciliation path is missing | private margin checks, liquidation, support correction and future API changes |
来源地图
- Coinbase Developer Documentation:Get Single Order(coinbase-get-order)
- Coinbase Developer Documentation:Cancel an Order(coinbase-cancel-order)
- Kraken API Documentation:WebSocket v2 Add Order(kraken-ws-add-order)
- OKX:Place Order(okx-place-order)
- Bybit API Documentation:Place Order(bybit-place-order)
控制说明
1. Client identity
这一项要求读者把公开来源翻译成操作规则。这里的含义是:client-supplied order identity helps correlate requests but is not the same as exchange final state。可执行动作是:log the non-secret client id and exchange id separately。仍然未知的是:whether a lost request reached the matching engine。因此本文不会把未知部分包装成收益承诺、牌照承诺、审批保证、安全保证、恢复保证、平台排名或价格暗示。
2. Acknowledgement layer
这里的含义是:venue acknowledgement can arrive before final execution, rejection or cancellation is known。可执行动作是:separate request accepted, order open, partially filled, filled, canceled and rejected states。仍然未知的是:network loss between acknowledgement and final state。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
3. Retry rule
这里的含义是:retries can duplicate risk when client id reuse and final-state checks are unclear。可执行动作是:require a lookup or cancel-reconcile route before repeating a mutating request。仍然未知的是:venue-specific idempotency windows and purged historical records。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
4. Cancel evidence
这里的含义是:a cancel response or cancel reject needs its own evidence chain。可执行动作是:record cancel request id, product or symbol, venue response and final state。仍然未知的是:orders already filled, already canceled or no longer queryable。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
5. Stop condition
这里的含义是:automation should stop when it cannot prove whether an order exists or changed state。可执行动作是:pause trading if client id, venue id, final state or reconciliation path is missing。仍然未知的是:private margin checks, liquidation, support correction and future API changes。
操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。
仍需明确的未知项
- whether a lost request reached the matching engine
- network loss between acknowledgement and final state
- venue-specific idempotency windows and purged historical records
- orders already filled, already canceled or no longer queryable
- private margin checks, liquidation, support correction and future API changes
实用结论
Client order identity 是重试安全字段,不是完整执行回执。Coinbase Exchange 文档允许按 exchange id 或 client-assigned client_oid 查询或取消订单;Kraken WebSocket v2 add_order 文档暴露 order-entry request fields;OKX 记录 place-order behavior;Bybit 在下单控制中记录 orderLinkId。雷达结论是:安全机器人在重试任何可变更订单请求前,必须记录非秘密 client id、venue order id、acknowledgement、cancel result、final order state 与 reconciliation route。 本文停在证据边界内,帮助读者决定下一步核验什么,而不是把公开文档改写成私人账户、钱包、API key、池子路径、稳定币余额、代币化资产或政策框架在任何未来条件下都能成功的承诺。
来源与证据
05- Get Single Order
- Cancel an Order
- WebSocket v2 Add Order · docs.kraken.com
- Place Order · okx.com
- Place Order