FILLED or PARTIALLY FILLED orders in futures

Hello. I’m implementing websockets and everything working fine but I need some clarifications.

When I receiving PARTIALLY_FILLED order event on sockets should I process it or skip it. I’m creating user trade history based on events, so I need only final order.

Questions:

  1. will wss://fstream.binance.com send FILLED order always after PARTIALLY FILLED? Its not easy to test, because I dont want use huge orders for testing, but small one processing instantly.

  2. What you recommend about processing FILLED and PARTIALLY FILLED orders. Because ID always new even if its the same limit order. I’m worry what will happen if user cancel order partially filled?

Or I make this more complicated and I need just straight processing every order event and use “l” to see how many contracts actually was bought?

Could you please explain in what order ORDER event happening and should I worry about corruption of user local trade history

Hello,

  1. The events from “User Data Stream” are usually sent in correct order, although during heavy periods this order might be affected, i.e, it’s not guaranteed that event “ORDER_TRADE_UPDATE” with PARTIALLY FILLED will always be received before FILLED.

As for the rest of your questions, I got a bit confused, could you specify your concern with a more detailed example, please?

Thx

I apologize if I explain poorly!

Suppose such a situation, a simple order for 100 contracts at a price of $ 1.

The user has placed an order for 100 contracts

I am getting data by socket:

  1. +50 = partially filled 50/100
  2. +30 = partially filled 30/100 or 80/100?
  3. +20 = 100/100 filled

If the user canceled the order after 2 events. Will 3 ever come? For example: 80/80 is filled or the “canceled” order event will come and nothing else.

My task is to process as little data as possible, but at the same time get an accurate history, and I would like to skip all these partially filled orders to save server resources.
But I’m afraid that if I don’t process them, I might get errors.

No, the rest would be cancelled