Bug (?) Order wrongly filled as it did not expire at Good Til Time

Excuse me if double posting, the previous post got (wrongly) spam-filtered, perhaps because I pasted a link in it.
On with the issue:

On 2023-06-08 one of my orders got filled even though the good-till-time already passed.

It concerns order id: b7d2fc22-eecb-4cde-8101-ab7fc07bfaa1

In the screenshot in you can see that the “Good Til Time” is “8/06/23 04:59:33” but the “Time of Last Fill” is LATER than that: “8/06/23 05:21:49”
This is very concerning as clearly the Good Til Time was not honored.
I submitted it by API, and I have some logs of the websocket user channel for further proof:

{"channel":"user","client_id":"","timestamp":"2023-08-06T02:59:24.574548985Z","sequence_num":18898,"events":[{"type":"update","orders":[{"order_id":"b7d2fc22-eecb-4cde-8101-ab7fc07bfaa1","client_order_id":"<censored>","cumulative_quantity":"0","leaves_quantity":"11.92","avg_price":"0","total_fees":"0","status":"PENDING","product_id":"USDT-EUR","creation_time":"2023-08-06T02:59:24.323202Z","order_side":"BUY","order_type":"Limit","cancel_reason":"","reject_Reason":""}]}]}

{"channel":"user","client_id":"","timestamp":"2023-08-06T02:59:24.574594246Z","sequence_num":18899,"events":[{"type":"update","orders":[{"order_id":"b7d2fc22-eecb-4cde-8101-ab7fc07bfaa1","client_order_id":"<censored>","cumulative_quantity":"0","leaves_quantity":"11.92","avg_price":"0","total_fees":"0","status":"OPEN","product_id":"USDT-EUR","creation_time":"2023-08-06T02:59:24.323202Z","order_side":"BUY","order_type":"Limit","cancel_reason":"","reject_Reason":""}]}]}

Because my bot noticed that it did not expire, it even attempted to cancel it (see "cancel_reason":"User requested cancel"), but it does not get cancelled by Coinbase:

{"channel":"user","client_id":"","timestamp":"2023-08-06T02:59:47.07517172Z","sequence_num":18906,"events":[{"type":"update","orders":[{"order_id":"b7d2fc22-eecb-4cde-8101-ab7fc07bfaa1","client_order_id":"<censored>","cumulative_quantity":"0","leaves_quantity":"11.92","avg_price":"0","total_fees":"0","status":"OPEN","product_id":"USDT-EUR","creation_time":"2023-08-06T02:59:24.323202Z","order_side":"BUY","order_type":"Limit","cancel_reason":"User requested cancel","reject_Reason":""}]}]}

Eventually it just gets filled:

{"channel":"user","client_id":"","timestamp":"2023-08-06T03:21:49.251072367Z","sequence_num":2,"events":[{"type":"update","orders":[{"order_id":"b7d2fc22-eecb-4cde-8101-ab7fc07bfaa1","client_order_id":"<censored>","cumulative_quantity":"11.92","leaves_quantity":"0","avg_price":"0.9077","total_fees":"0","status":"FILLED","product_id":"USDT-EUR","creation_time":"2023-08-06T02:59:24.323202Z","order_side":"BUY","order_type":"Limit","cancel_reason":"User requested cancel","reject_Reason":""}]}]}

So the issue is two-fold:
1: Coinbase does not honor the good-till-time. The order does NOT expire when it should.
2: When I submit a cancel request, Coinbase receives it, as proven by “User requested cancel”, but Coinbase does not ACTUALLY cancel it.
As the order keeps hanging, it eventually gets filled at a time WAY beyond the good-till-time.

Could you please confirm what happened here and whether this is a bug?

I would suggest to get order and fills with API and check timestamps there. Maybe it is just bug in UI!?

Thanks but it is not just the UI. The snippets I post above are the direct API data (from the websocket “user” channel). Also my balance actually changed, so the trade did happen (while it shouldn’t have).

Here is the same order as requested via the REST API. Note the “end_time” compared to “last_fill_time”, and it is clear that my end time just got ignored.

{"orders":[
  {
    "order_id":"b7d2fc22-eecb-4cde-8101-ab7fc07bfaa1", 
    "product_id":"USDT-EUR",
    "user_id":"<censored>",
    "order_configuration": {
      "limit_limit_gtd":{
        "base_size":"11.92",
        "limit_price":"0.9077",
        "end_time":"2023-08-06T02:59:33.371053677Z",
        "post_only":true
      }
    },
    "side":"BUY",
    "client_order_id":"<censored>",
    "status":"FILLED",
    "time_in_force":"GOOD_UNTIL_DATE_TIME",
    "created_time":"2023-08-06T02:59:24.323202Z",
    "completion_percentage":"100.00",
    "filled_size":"11.92",
    "average_filled_price":"0.9077",
    "fee":"",
    "number_of_fills":"1",
    "filled_value":"10.819784",
    "pending_cancel":true,
    "size_in_quote":false,
    "total_fees":"0",
    "size_inclusive_of_fees":false,
    "total_value_after_fees":"10.819784",
    "trigger_status":"INVALID_ORDER_TYPE",
    "order_type":"LIMIT",
    "reject_reason":"REJECT_REASON_UNSPECIFIED",
    "settled":true,
    "product_type":"SPOT",
    "reject_message":"",
    "cancel_message":"User requested cancel",
    "order_placement_source":"RETAIL_ADVANCED",
    "outstanding_hold_amount":"0",
    "is_liquidation":false,
    "last_fill_time":"2023-08-06T03:21:49.084943Z"
  }
],"sequence":"0","has_next":false,"cursor":""}

That does look like bug unless there are unwritten rules… You will have to wait for response from Coinbase.

Hi @Darrow! Thank you for using our APIs. We appreciate you sharing this. Please allow us some time to look into it and we will reach out with an update. Please keep in touch.

1 Like

Thank you for your patience @Darrow! We have shared this with our team and they are working on it. While we are unable to provide an ETA for this. We are making sure that this is corrected. We will share an update here as soon as this is fixed. We appreciate your patience and understanding in this matter.

1 Like

Hi, any update on this? It’s been two weeks, and it’s a pretty critical issue if Coinbase just arbitrarily ignores Good Til Time and order cancellations. I don’t dare the use the API for any serious trading if it behaves like that.

Hi, @Darrow! Thank you for your patience. We shared this with our internal team and we would like to inform you that, generally this does not happen, however in your case it seems like a temporary issue and we are taking all the steps necessary to avoid this in the future. We appreciate this feedback and your understanding in this matter. Hope this helps. Do let us know in case you have any more questions or concerns.

Indeed generally this does not happen, but if it happens once in a blue moon that’s still an unacceptable risk (for any user). So I would like to know: has an actual fix been implemented? Or is it more like the team can’t explain why it happened either and they are keeping an eye on whether it happens again?

Hi @Darrow for now our team has taken a note of this, we will let you know as soon as there are any updates regarding this. Please keep in touch.

“taken a note” means they have not actually implemented any fix? I appreciate your answers but please be more straightforward if you can.

Anyway, I think the issue happened AGAIN today. Example:

Order a339b635-32e3-4e44-b72f-e0d50c30ffca is created with “creation_time”:“2023-09-15T08:01:16.379453Z”, it is a good-until with end time “2023-09-15T08:01:25.333955788Z” (you can see this in the 3rd box)

{"channel":"user","client_id":"","timestamp":"2023-09-15T08:01:16.530120799Z","sequence_num":17,"events":[{"type":"update","orders":[{"order_id":"a339b635-32e3-4e44-b72f-e0d50c30ffca","client_order_id":"<cencored>","cumulative_quantity":"0","leaves_quantity":"3.85","avg_price":"0","total_fees":"0","status":"OPEN","product_id":"USDT-EUR","creation_time":"2023-09-15T08:01:16.379453Z","order_side":"BUY","order_type":"Limit","cancel_reason":"","reject_Reason":""}]}]}

Then, one minute after the expiration time it still does NOT expire, and I send a cancel, which gets confirmed (at least the cancel works this time). Note “timestamp”:“2023-09-15T08:02:34.029502608Z” and “status”:“OPEN”, which is proof that the order is still open way past its expiration time.

{"channel":"user","client_id":"","timestamp":"2023-09-15T08:02:34.029502608Z","sequence_num":24,"events":[{"type":"update","orders":[{"order_id":"a339b635-32e3-4e44-b72f-e0d50c30ffca","client_order_id":"<cencored>","cumulative_quantity":"0","leaves_quantity":"3.85","avg_price":"0","total_fees":"0","status":"OPEN","product_id":"USDT-EUR","creation_time":"2023-09-15T08:01:16.379453Z","order_side":"BUY","order_type":"Limit","cancel_reason":"User requested cancel","reject_Reason":""}]}]}

When I call the Get Order REST end point to check the overview, it looks like this (here it states the intended “end_time”:“2023-09-15T08:01:25.333955788Z”).

{"order":{"completion_percentage":"0","cancel_message":"User requested cancel","last_fill_time":null,"edit_history":[],"reject_message":"","size_inclusive_of_fees":false,"order_placement_source":"RETAIL_ADVANCED","fee":"","size_in_quote":false,"total_value_after_fees":"0","pending_cancel":false,"trigger_status":"INVALID_ORDER_TYPE","number_of_fills":"0","product_id":"USDT-EUR","order_type":"LIMIT","created_time":"2023-09-15T08:01:16.379453Z","side":"BUY","client_order_id":"<censored>","average_filled_price":"0","total_fees":"0","settled":false,"filled_value":"0","reject_reason":"REJECT_REASON_UNSPECIFIED","outstanding_hold_amount":"0","order_configuration":{"limit_limit_gtd":{"base_size":"3.85","end_time":"2023-09-15T08:01:25.333955788Z","post_only":true,"limit_price":"0.93698"}},"time_in_force":"GOOD_UNTIL_DATE_TIME","product_type":"SPOT","user_id":"<censored>","filled_size":"0","order_id":"a339b635-32e3-4e44-b72f-e0d50c30ffca","is_liquidation":false,"status":"CANCELLED"}}

Btw, why does it have “trigger_status”:“INVALID_ORDER_TYPE”? If the order type was really invalid, why was the order OPEN in the first place?

But most importantly, can you please check if and why this order did not expire at the “end_time”?