Duplicate orders placed with a single API call

ruc_z
ruc_z edited October 2019 in Java client
Hi,

I am using Zerodha Java client to place orders. Today at Thu Oct 10 14:45:14 IST 2019.
I am pretty sure that I called the API once but I saw that two orders got placed together with different order ids but with timestamps that are one second apart.
For reference I got a network connection 5 seconds before placing the order (at 14:45:09). I called get orders to double check if there is a order that was placed. I did not get any open/filled order for the script. 5 seconds later i.e. at 14:45:14 I placed another order with Zerodha, but I noticed that two orders got created with timestamp 14:45:14 & 14:45:15.
I am not sure why this would happen. I am pretty sure that my code is defensive enough to deal with transient network issues and not place duplicate orders. Also t he logs clearly indicate that the duplicate orders where created together and I got the order tick from streaming API at the same instance. So I am very sure that the two orders got created in a single API call.
Let me know if you need any additional information that you want me to provide to help in finding the problem.
Also for reference the order ids are:
"orderId":"191010002961521", "orderTimestamp":1570698914000
"orderId":"191010002962329", "orderTimestamp":1570698915000

-r
  • rakeshr
    @ruc_z
    Can you DM your used client_id and exchange order_id and scrip name?
  • ravishastry
    ravishastry edited June 2021
    Hi, @rakeshr, I am also facing the same issue. Can you please let me know what is the solution for the same?
    We are incurring losses and issues in our program due to the same. (Using Python Client)
  • sujith
    Can you private message the client id, order id? We will check and let you know. It is very unlikely that a python library is doing that. It is being used in production by thousands of users. We have never come across this issue.
  • saurabhvFnO
    Even I face the same issue , order is sent twice yesterday as well as today :

    find below the reference, 2nd order was sent after 2 second

    Order ID
    210708202086002
    Exchange order ID
    1000000030844899
    Time
    2021-07-08 12:17:45
    Exchange time
    2021-07-08 12:17:45
    Placed by
    PS6228


    Order ID
    210708202086748
    Exchange order ID
    1000000030864078
    Time
    2021-07-08 12:17:47
    Exchange time
    2021-07-08 12:17:47
    Placed by
    PS6228



  • sujith
    saurabhvFnO,
    Kite Connect is just a library that exposes, method calls. It won't call a method by itself. You can put some logs and check at your end.
  • saurabhvFnO
    Agreed, but I have observed it multiple times, will share logs with once it happen again.

    It is not happening consistently, my observation is when price is volatile & place market order it execute twice.so look like a bug on execution layer
Sign In or Register to comment.