Hypothetical market order situation

In a hypothetical situation, if a buyer places a buy market order and a seller places a sell market order at what price will the order get traded?

Let’s assume apart from these 2 people there are no other buyers/sellers in the market.

Orders are always matched on price-time priority.

When orders are being matched for the sake of execution and if there’s a situation where a market order has to be matched with another market order then the one of the following 2 cases may happen:

  • In the opposite order book there may be an outstanding limit order. In such a case since there is a best bid/offer price, that becomes the price for that trade.

  • If the opposite order book has no outstanding order then the trade happens at the “reference price” The reference price is mostly the last traded price of the security on a given day. In case it has not traded on that day, then the reference price will be the previous day’s close price.


Is this what happens in NSE? Are you sure?
I think market orders are not queued, and so if a opposite book does not contain any limit order entry, the market order then automatically gets converted to a limit order with lower price limit and queued in the ELOB.
Since orders are executed one by one, (NSE server, does not queue market orders), two market orders facing each other is unlikely. Once the server faces a market order, it immediately executes or queues it as limit order witthin that fraction of second. Such that the second market order reaches the server only after first order gets settled. Execution time is faster than order receiving time.
I could be wrong, please clarify?