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.
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 …
I have pretty similar situation, but I intended to place GTX (PostOnly) order.
My log:
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}
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.