The overall order routing and matching system of the exchange is depicted in diagram given below
Orders, as and when they are received, are first time stamped and then immediately processed for a potential match. If a match is not found, the orders are stored in different 'books'. Orders are stored in price-time priority in various books in the following sequence:
- Best Price
- Within Price, by time priority
Order Matching Rules
The best buy order is matched with the best sell order. An order may match partially with another order resulting in multiple trades. For order matching, the best buy order is the one with the highest price and the best sell order is the one with lowest price. This is because the system views all buy orders available from the point of view of a seller and all sell orders from the point of view of the buyers in the market. So, of all buy orders available, a seller would obviously like to sell at the highest possible buy price that is offered. Hence, the best buy order is the order with highest price and vice-versa.
Members can pro-actively enter orders into the system which will be displayed in the system until the full quantity is matched by one or more of counter-orders and result into trade(s). Alternatively members may be reactive and put in orders that match with existing orders in the system. Orders lying unmatched in the system are 'passive' orders and orders matching the existing orders are called 'active' orders. Orders are always matched at the passive order price. This ensures that the earlier orders get priority over the orders that come in later.