You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何确认限价订单已完成成交?基于GDAX Node API的技术咨询

判断GDAX限价订单的成交状态(部分/全部成交)

Great question—let’s break down how to reliably verify if your GDAX limit order has been filled (either partially or fully) using the Node API, and clarify the gaps in your current approach.

核心字段解析

When you call getOrder(orderId), the returned order object has several key fields that let you pinpoint exactly what happened to your order:

  • status: The overall state of the order. Only when status is 'done' does the order stop being active (it’s concluded, whether filled, canceled, or rejected).
  • settled: A boolean indicating if the order’s funds have been finalized. This will be true if any portion of the order was filled and the corresponding funds have cleared. If the order ended without any fills (e.g., canceled immediately, rejected), settled stays false.
  • done_reason: Why the order ended—this is critical for distinguishing scenarios:
    • 'filled': The order was completely filled by matching orders
    • 'canceled': The order was canceled (either by you, or partially filled then canceled)
    • 'rejected': The order was rejected by the platform (e.g., invalid price, insufficient funds—no fills occurred here)
  • filled_size: The total quantity that was actually matched. A value greater than 0 confirms at least partial fill.

精准判断逻辑

To check if your order has completed any level of filling (partial or full), use this logic:

const order = await gdaxClient.getOrder(orderId);

if (order.status === 'done' && order.settled === true) {
  // The order has at least partial fills, and funds are settled
  if (order.done_reason === 'filled') {
    console.log('Order was fully filled');
  } else if (order.done_reason === 'canceled' && order.filled_size > 0) {
    console.log('Order was partially filled before being canceled');
  }
} else if (order.status === 'done' && order.settled === false) {
  // The order ended with no fills at all
  console.log('Order concluded without any fills');
} else {
  // Order is still active (status will be 'pending' or 'open')
  console.log('Order is still on the book');
}

关键澄清

  • Your initial check (status: 'done' + settled: true) is a solid baseline for confirming that some fill occurred and settled. But adding done_reason and filled_size lets you distinguish between full and partial fills, which is useful for tracking order outcomes.
  • settled: true will never be true for an order that had zero fills—so this field alone can rule out orders that ended without any matching activity.

内容的提问来源于stack exchange,提问作者NZHammer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:27:27