Order Fulfillment Amounts in the Orders API
Overview
When querying order details via the Orders API endpoints, the returned asset_token_quantity and payment_token_quantity fields represent the placed order quantities, not the actual fulfilled amounts. This is a common point of confusion for integrators.
💡Reference: Get Order Fulfillments
The Issue
The asset_token_quantity and payment_token_quantity fields in the Orders API responses reflect the amount the user initially requested at order placement. They do not reflect:
- Partial fills
- Final settled amounts
- Adjustments due to market price changes or slippage
Relying on these fields for reconciliation, settlement tracking, or balance updates will lead to inaccuracies.
The Correct Approach
To obtain the actual fulfillment amounts for an order, we must query the Order Fulfillments API endpoints.
⚠️ Important Notes:
- Each order can have multiple fulfillments (e.g., partial fills over time).
- The sum of all fulfillments for a given order equals the total settled amount.
- Fulfillment records contain precise, finalized quantities for both the asset and the payment token.
Best Practices
- Do not use
asset_token_quantityorpayment_token_quantityfrom the Orders API for:
- Updating user balances
- Calculating fees
- Confirming order completion
- Always fetch fulfillment records for an order to:
- Determine the net settled quantity
- Handle partial fills correctly
- Reconcile transactions with external systems
- Iterate over all fulfillments associated with an order ID, as a single order may have one or more entries.
Additional Context
| API | Purpose | Fields to Use |
|---|---|---|
| Orders API | Order placement and high-level status | For order creation confirmation only |
| Order Fulfillments API | Settlement and execution details | For actual transferred amounts |
Related Questions
- Q: Why would an order have multiple fulfillments?
A: Due to liquidity fragmentation, market depth, or execution over time, a single limit or market order may be filled across several distinct trades. - Q: Should I sum all fulfillments to get the total?
A: Yes. The sum of all fulfillment amounts equals the final settled quantity for that order.
Updated about 6 hours ago
Did this page help you?
