Multiple Order update received from WebSocket

ShaileshMoolya
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.

Can anyone Identify why the is happening.

Note : using Kiteconnect .net client 3.0.7.0
  • SRIJAN
    SRIJAN edited June 21
    The order updates are async calls sent by the OMS. You have to handle this at your end.

    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.
  • ShaileshMoolya
    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.

    in short every order update sends 2 updates
  • SRIJAN
    SRIJAN edited June 21
    Sometimes the OMS can send repeated order 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.
  • ShaileshMoolya
    @SRIJAN Thank you for your quick reply and solving my queries.
This discussion has been closed.