i am receiving Multiple Order update from Websocket of instead of one update.
first update is the new update of a particular order and second update is the update with old values. So, my order windows show no change as the new values are overridden by the old values in the 2nd update.
I can understand if it is async. But there is an error in it. eg. suppose i create an order with quantity 10, then i received an order update in websocket. then i modify this order and change quantity to 9. this time i receive 2 order update 1st update is with Quantity 9 and 2nd update is with quantity 10
then again i modified quantity to 8. again i receive 2 update 1st update is with Quantity 8 and 2nd update is with quantity 9.
Refer this thread:
https://kite.trade/forum/discussion/8469/order-updates-not-coming-in-sequence
Ideally,you should use order updates as events to fetch orderbook/positions ,and update your database based on the orderbook/positions.
eg. suppose i create an order with quantity 10, then i received an order update in websocket.
then i modify this order and change quantity to 9. this time i receive 2 order update
1st update is with Quantity 9 and
2nd update is with quantity 10
then again i modified quantity to 8. again i receive 2 update
1st update is with Quantity 8 and
2nd update is with quantity 9.
in short every order update sends 2 updates
As mentioned above, it's not recommended to use order updates for database updates.
Use order updates as events,and then fetch orderbook/positions and use that.