Placing orders in parallel in different threads - one or many instances of KiteConnect object?

malko84
malko84 edited March 2023 in Python client
Hi,
My plan is to place/modify multiple orders in parallel. Each order will be placed and managed by a different thread till the order is executed.
Questions:
Do I need to create a separate instance of KiteConnect object in each thread?
If not, do I need to use a lock to avoid simultaneous access of the KiteConnect object created in the main thread?

@sujith
  • jits_1998
    In my understanding you can create multiple objects of kite connect with same access key, only thing you need to be careful about is the api limits.
  • malko84
    Thanks jits_1998. Does that mean I can create any number of KiteConnect instances without limitations? I am aware of the API order rate limits.
  • jits_1998
    Yes, it's just an object that holds the key and uses it in every api call. However, there is a limit on how many websocket connection you can open, it is limited to 3 per key.

    That's my understanding.
  • rakeshr
    Does that mean I can create any number of KiteConnect instances without limitations?
    Yes, as @jits_1998 mentioned. You can spin up n-child instances but all requests should be within the rate limit.
Sign In or Register to comment.