Function: _executeBidLimitOrder(PerpBook ds, Order newOrder, LimitOrderType limitOrderType)
This internal function handles the matching and placement of a taker bid limit order (a BUY
order) against the ask side of the order book. If the bid is not fully filled, the remaining portion can be placed into the order book.
Branches and code coverage
Intended branches
Order fully matches against existing asks.
Order partially matches — remainder is placed on the book.
Order does not match at all, and the entire order is placed on the book.
Negative behavior
limitOrderType == LimitOrderType.POST_ONLY && BestAsk <= newOrder.price
.numBids > maxNumOrders
andnewOrder.price < MinBidPrice
.