Function: _executeFillOrder(ClearingHouse self, byte[32] asset, address account, PostFillOrderArgs args)
The internal _executeFillOrder function handles the execution of filling orders. It performs the following:
Funding-payment settlement by calling
settleFundingPaymentExecution of the
market[asset].postFillOrder(...)function, which handles order execution and returns apositionResultExecution of
collateralManager.settleTakerFillLiquidation safety check
Processing of
takerFee
Branches and code coverage
Intended branches
fundingPaymentResult.marginDeltais applied correctly topositionResult.marginDelta.fundingPaymentResult.debtis applied correctly topositionResult.debt.The position is increased or decreased as expected.
If
positionResult.fullClose == true, the position is removed from user positions.Margin and debt balances are updated properly in
settleTakerFill.