Technical clarification: LIMIT + IOC, order reconciliation and primary/backup host failover

CHANDER
Hello Zerodha Team,

I am researching the technical and operational requirements for a risk-controlled retail algorithmic trading system using Kite Connect.

I would appreciate clarification on the following API behaviour. I am seeking documented technical information and am not assuming that API support by itself establishes regulatory permission.

A. LIMIT + IOC and order types

1. Does Kite Connect support placing LIMIT + IOC orders for NFO NIFTY index options through an individual retail Kite Connect API application?

2. Are there any Kite Connect, account-level, exchange, or retail-algo restrictions or prerequisites that would prevent or limit this order combination?

3. How does Market Protection (MPP) apply to API orders? Does it apply only to MARKET orders, or can it affect LIMIT orders as well? Please clarify the distinction between submitting MARKET + MPP and LIMIT + IOC.

B. Partial fills and order reconciliation

4. For a LIMIT + IOC order that is partially filled, does the API report the executed quantity and automatically cancelled unfilled remainder separately?

5. Which API endpoints and response fields should be treated as authoritative for determining the final order status, filled quantity, cancelled quantity, pending quantity and average execution price?

6. Can order-book, order-history, trade-book and positions data temporarily disagree or arrive at different times? What is the recommended reconciliation procedure in such cases?

7. If an IOC order is not matched at all, what final status and response fields should the client expect?

8. If an order is partially filled and the remainder is cancelled, is the order's final status reliably distinguishable from a fully filled or fully cancelled order?

C. Ambiguous submissions, retries and idempotency

9. If an order-placement request times out or the client loses its connection before receiving the order ID, how should the client determine whether Zerodha accepted the order?

10. Does Kite Connect provide a documented idempotency key or any other mechanism that guarantees duplicate prevention when an order-placement request is retried?

11. Can the optional order tag be used to locate an order whose placement response was lost? Is the tag searchable through order APIs, and does it provide any duplicate-order prevention guarantee?

12. What is the recommended procedure before retrying an order when the original submission has an unknown status?

D. Primary/backup hosts and static IPs

13. If an application has two registered static IP addresses (primary and secondary), does Zerodha enforce any broker-side mechanism that prevents both hosts from placing orders simultaneously?

14. Is there any supported ownership, fencing, or failover mechanism that prevents a previously active host from continuing to submit orders after a backup host takes over?

E. API limits and operational details

15. Please clarify the applicable order-placement, modification, cancellation and order-query rate limits, along with the availability and retention period of order and trade records needed for reliable reconciliation.

Where possible, please provide links to the relevant official documentation or applicable technical rules.

Thank you.
  • nagavenij
    1: Yes, Kite Connect supports placing LIMIT orders with IOC validity.
    2: LIMIT orders with IOC validity are supported through Kite Connect APIs. Any quantity matched immediately at the specified limit price or better will be executed, while the unmatched quantity will be cancelled immediately. No additional account-level requirements apply, subject to exchange rules.
    3: Market Protection applies to MARKET and SL-M orders. It does not apply to LIMIT orders.
    4: Although LIMIT + IOC is a supported combination, the order may remain open briefly while the exchange processes the matching and cancellation. Since the order has IOC validity, any unmatched quantity will be cancelled.
    5:You can use the following APIs:
    Order book (GET /orders) to retrieve all orders for the day.
    Order history (GET /orders/:order_id) to check the status and history of a particular order.
    Trade book (GET /trades) to retrieve all executed trades.
    Order trades (GET /orders/:order_id/trades) to retrieve trades associated with a particular order.
    The order response includes fields such as status, filled_quantity, pending_quantity, cancelled_quantity and average_price
    6: The order book, order history, trade book and positions data represent different aspects of order processing and execution.
    Order status updates can be tracked through WebSocket. The order book and individual order-history API provide the latest order status, while the trades API provides details of actual executions, including partial fills. The positions API reflects the resulting net and day positions.
    To verify order execution, refer to the trade book for the actual executed quantities and prices, and use the positions API to validate the resulting positions.

    7:If an IOC order is not matched, the unmatched quantity will be cancelled.
    8: Yes. A partially filled order whose remaining quantity is cancelled can be distinguished using the order response fields. The status will be CANCELLED, but the filled_quantity will reflect the executed quantity and cancelled_quantity will reflect the unfilled quantity. A fully filled order will have COMPLETE status.
    9: If an order-placement request times out or the response does not return an order ID, you can fetch the order book and verify whether the order was successfully placed. You can check the order details before retrying the request to avoid duplicate orders.
    10: Kite Connect does not provide a dedicated client-supplied idempotency key that guarantees duplicate-order prevention.However, the following mechanisms are available for order identification:
    Tag: An optional parameter that can be passed while placing an order. You can use a unique tag to identify and filter orders in the order book. However, using the same tag does not prevent duplicate order placement.
    Order ID: A unique identifier returned when an order is successfully placed. It can be used to retrieve the order details and history.
    GUID: An unusable request ID returned in the order response. It is not a client-supplied idempotency key and should not be treated as a mechanism for safely retrying requests.
    11: Yes, you can use the optional tag parameter to identify and filter orders in the order book.
    12: You can fetch the order book and filter the orders using the corresponding tag to check whether the original order was received. Verify the order status before attempting to place the order again.
    13: You can register two static IP addresses (primary and secondary) in the Developer Console. Both registered IPs can be used for order placement.
    14: Kite Connect does not provide an automatic host ownership, fencing or failover mechanism to prevent both hosts from placing orders simultaneously. This needs to be managed at your level.
    15: Rate limits
Sign In or Register to comment.