LIMIT order gets EXPIRED

Hi folks.

I occasionally run into an issue where Binance would set my LIMIT order to EXPIRED state right after order being created. Orders stream would return NEW order update when order is created but then immediately send EXPIRED order update. This happens randomly and I can not understand why.

Please help figure it out. Thanks.

Thanks for the feedback, could you please give more details for investigation,

  • the original order details as in open status
  • the order details in expired status

thank you

The order id was 44442871. Here is the log output for the NEW order event:

0|server | 2020-09-28T21:15:16: { orderId: 44442871,
0|server | 2020-09-28T21:15:16: symbol: ‘BZRXUSDT’,
0|server | 2020-09-28T21:15:16: status: ‘NEW’,
0|server | 2020-09-28T21:15:16: clientOrderId: ‘IjEZIk9mNUPo82AuLksnNf’,
0|server | 2020-09-28T21:15:16: price: ‘0.2138’,
0|server | 2020-09-28T21:15:16: avgPrice: ‘0.0000’,
0|server | 2020-09-28T21:15:16: origQty: ‘1’,
0|server | 2020-09-28T21:15:16: executedQty: ‘0’,
0|server | 2020-09-28T21:15:16: cumQty: ‘0’,
0|server | 2020-09-28T21:15:16: cumQuote: ‘0’,
0|server | 2020-09-28T21:15:16: timeInForce: ‘GTX’,
0|server | 2020-09-28T21:15:16: type: ‘LIMIT’,
0|server | 2020-09-28T21:15:16: reduceOnly: true,
0|server | 2020-09-28T21:15:16: closePosition: false,
0|server | 2020-09-28T21:15:16: side: ‘SELL’,
0|server | 2020-09-28T21:15:16: positionSide: ‘BOTH’,
0|server | 2020-09-28T21:15:16: stopPrice: ‘0’,
0|server | 2020-09-28T21:15:16: workingType: ‘CONTRACT_PRICE’,
0|server | 2020-09-28T21:15:16: priceProtect: ‘false’,
0|server | 2020-09-28T21:15:16: origType: ‘LIMIT’,
0|server | 2020-09-28T21:15:16: updateTime: 1601316916642 }

After 2 milliseconds EXPIRED event was received for this order. Don’t have log for this update though.

timeInForce: GTX ???

yeah I think that is the reason. I am using a third party library to create orders and not sure why GTX is used by default there. How is it different from GTC? Confused …

Time in force (timeInForce):

This sets how long an order will be active before expiration.

Status Description
GTC Good Til Canceled
An order will be on the book unless the order is canceled.
IOC Immediate Or Cancel
An order will try to fill the order as much as it can before the order expires.
FOK Fill or Kill
An order will expire if the full order cannot be filled upon execution.
1 Like

Hi there!

I have pretty similar situation, but I intended to place GTX (PostOnly) order.
My log:

  1. The response to newOrder is ok:
    {“orderId”:9046217361,“symbol”:“BTCUSDT”,“status”:“NEW”,“clientOrderId”:“163971341762”,“price”:“16150”,“avgPrice”:“0.00000”,“origQty”:“0.003”,“executedQty”:“0”,“cumQty”:“0”,“cumQuote”:“0”,“timeInForce”:“GTX”,“type”:“LIMIT”,“reduceOnly”:false,“closePosition”:false,“side”:“BUY”,“positionSide”:“BOTH”,“stopPrice”:“0”,“workingType”:“CONTRACT_PRICE”,“priceProtect”:false,“origType”:“LIMIT”,“updateTime”:1605201575689}
  2. Than after 20-30 ms await I receive 2 messages simultaneously in web sockets:
    {“e”:“ORDER_TRADE_UPDATE”,“T”:1605201575689,“E”:1605201575693,“o”:{“s”:“BTCUSDT”,“c”:“163971341762”,“S”:“BUY”,“o”:“LIMIT”,“f”:“GTX”,“q”:“0.003”,“p”:“16150”,“ap”:“0”,“sp”:“0”,“x”:“NEW”,“X”:“NEW”,“i”:9046217361,“l”:“0”,“z”:“0”,“L”:“0”,“T”:1605201575689,“t”:0,“b”:“48.44766”,“a”:“0”,“m”:false,“R”:false,“wt”:“CONTRACT_PRICE”,“ot”:“LIMIT”,“ps”:“BOTH”,“cp”:false,“rp”:“0”,“pP”:false,“si”:0,“ss”:0}}
    {“e”:“ORDER_TRADE_UPDATE”,“T”:1605201575689,“E”:1605201575693,“o”:{“s”:“BTCUSDT”,“c”:“163971341762”,“S”:“BUY”,“o”:“LIMIT”,“f”:“GTX”,“q”:“0.003”,“p”:“16150”,“ap”:“0”,“sp”:“0”,“x”:“EXPIRED”,“X”:“EXPIRED”,“i”:9046217361,“l”:“0”,“z”:“0”,“L”:“0”,“T”:1605201575689,“t”:0,“b”:“48.44766”,“a”:“0”,“m”:false,“R”:false,“wt”:“CONTRACT_PRICE”,“ot”:“LIMIT”,“ps”:“BOTH”,“cp”:false,“rp”:“0”,“pP”:false,“si”:0,“ss”:0}}

What does it mean? Why did I receive New Ack in HTTP channel, and these two strange messages in web sockets?
This situation occurs pretty much regularly now.

Thank you

there is nothing strange here, hope this will be helpful to understand.

  • HTTP request client received the response as soon as the order passed validation and forwarded into further step.
  • The websocket server pushed the order with NEW status
  • The websocket server pushed the second message with EXPIRED status as it’s could be matched immediately which is conflict with GTX requirement.
1 Like