Hi, I’m in the process of testing a Python client, and have found that querying an order that I’ve successfully cancelled returns conflicting status and cancel messages. A cancel request succeeds with the following JSON response:
2023-01-17 07:00:33,619 -2198716 -INFO- COINBASE RESPONSE TEXT (POST 200):
{
"results": [
{
"success": true,
"failure_reason": "UNKNOWN_CANCEL_FAILURE_REASON",
"order_id": "aa...6d"
}
]
}
And a subsequent query of the order (synchronously), returns a query message with "status": "OPEN"
and "cancel_message": "User requested cancel"
, as below:
2023-01-17 07:00:33,727 -2198716 -INFO- COINBASE RESPONSE TEXT (GET 200):
{
"order": {
"order_id": "aa...6d",
"product_id": "USDT-USD",
"user_id": "...",
"order_configuration": {
"limit_limit_gtc": {
"base_size": "10",
"limit_price": "0.95",
"post_only": true
}
},
"side": "BUY",
"client_order_id": "...",
"status": "OPEN",
"time_in_force": "GOOD_UNTIL_CANCELLED",
"created_time": "2023-01-17T12:00:33.248230Z",
"completion_percentage": "0",
"filled_size": "0",
"average_filled_price": "0",
"fee": "",
"number_of_fills": "0",
"filled_value": "0",
"pending_cancel": true,
"size_in_quote": false,
"total_fees": "0",
"size_inclusive_of_fees": false,
"total_value_after_fees": "0",
"trigger_status": "INVALID_ORDER_TYPE",
"order_type": "LIMIT",
"reject_reason": "REJECT_REASON_UNSPECIFIED",
"settled": false,
"product_type": "SPOT",
"reject_message": "",
"cancel_message": "User requested cancel"
}
}
This is at the very least unexpected, but at least pending_cancel
is true. Can we assume an order will be cancelled if the cancellation request returns success, and a query of returns pending cancel
as true?
I’ve also subsequently run into "error_details": "order with this orderID was not found"
when querying an order I’ve just made (again, synchronously). Can an engineer elaborate on what the expected behavior of the matching engine is, and what a recommended way of handling it is? Surely we shouldn’t poll get_order until the matching engine realizes our confirmed order exists?
Thanks,
Brendan