So at what price and what volume will the deal eventually be made?
To understand this, let's go back to the "price" parameter of the order.
When a buyer placed an order "to buy 25 lots at $115 a share", the exchange takes it as "to buy 25 lots at a price not more than $115 a share". That is the purchase price can be less than the price stated in the order, but not more.
And when the seller earlier submitted an order "to sell 20 lots at $110 a share", the exchange takes it as "to sell 20 lots at a price not less than $110 a share". That is, it is possible to sell at a price higher than that specified in the order, but not less.
Once again: buyers always put orders "buy at no more than such-and-such a price", and sellers always put orders "sell at no less than such-and-such a price".
So, we return to the situation with the crossing of prices. When the exchange detects a crossover, it begins to execute the order that has caused this crossover. In our case, it is an order for 25 lots at $115 per share. This order kind of "eats up" all sell orders that are on the way to the price of $115 (that is, everything cheaper than $115), until it reaches 25 lots.
Which orders were "eaten up" in our case? One single order to sell is 20 lots at $110 per share.
What was "eaten" is recorded as a buy and sell trade in what's called a tape. It's similar to the way a cash register punches a check with a price. The record looks like this: FB $110 20 lots
However, we have a remainder after the trade is 5 lots, the remainder of those 25 at a price of $115. Since at this price (or lower) nothing can be "eaten", the order remains in the left page of the book until a suitable offer.
Let's see how the FB order book looks now, after the deal is done:
Let me note again that all orders in the book are sorted in descending order from top to bottom.
The concept of "book" is very useful for understanding how the exchange price is formed. In the past, when there were no electronic trading systems, there were so-called floor brokers, who used to collect and record prices and volumes of orders in a real book. Nowadays you may encounter alternative terms like Depth of Market (DOM), Level II, but they are all identical to the notion of an "order book".
The orders to buy that we see in the order book are called "bids", and the orders to sell are called "offers". So, in our order book there are two bids and no offers. All bids and offers are called "limit orders" because they have a price limit.
But there's also a type of order that we will never see in the book. Why? I'll tell you in the next post.