What is Market Order?

Updated 

Market order is an order to buy or sell immediately at the best available price. 

The best available price would be the best Bid/Ask from the depth. Order would be placed and executed as per the order book and liquidity depth of the asset. It is entered with order size only and not price.

Please check the below screenshot for the order book. 

Screenshot_2021-11-30_at_1.50.25_AM.png

Here, the Buy (Long) order should execute at 2.471 since that is the best Ask, and Sell (Short) order should execute at 2.470 since that is the best Bid in the depth. 

For example: Here, if you place a buy order for 10000 quantity, then partial quantity should execute at 2.471 as per the best ask and then remaining partial would go to the next best ask, i.e. 2.472 considering the above screenshot. 

Soon, we will simulate the market orders and the orders would be placed as per the below method. 

The market order will be placed as a limit order on the book with 10% price collar. In other words, the market order (whole or partial) will be executed if the realtime quote is within the 10% deviation from the market price when the order is placed. The unfilled portion of market order will be canceled.