Offer your thoughts or opinion on the input financial query or topic using your financial background.

How are unmarketable market orders (other side of the order book is empty) matched with incoming orders? [duplicate]
I don't have all the answers. On a illiquid stock, such situations do arise and there are specific mechanisms used by exchanges to match the order. It is generally not advisable to use market order on illiquid stock. There are lots of different variations here. I guess this comes down to specifications for individual exchanges, but I'm wondering if there's a standard here or a way to approach it from basic rules that clears up all these situations. There are quite a few variations and different treatments. Market order that are placed when the market is closed or just around market opening are traded at Market Open price that each exchange has a formulae to calculate. In the process Market Buy are matched to Market Sell at the Exchange calculated price. Not all order get matched and there could be spill over's. These are then matched to limit orders. Is this determined based on which sell order came first, or based on which would result in the best deal for the incoming buyer? Generally Market orders have highest priority of execution.