Function: _removeUnfillableOrder(PerpBook ds, Order order)
This internal function removes a limit order from the order book if the maker and taker are the same (self-trade), the order has expired, and the maker position becomes liquidatable during the processMakerFill execution.
Branches and code coverage
Intended branches
collateralRefundis calculated correctly.orderbookCollateralin the GTL contract is updated correctly.The order is fully removed from the order book.
quoteTokenOpenInterestis updated properly whenside == Side.BUY.baseTokenOpenInterestis updated properly whenside == Side.SELL.