Function: executeSettlement(EventTypes.Settlement settlement, uint64 eventId)
This processes the settlement execution. The function is called only by the OperatorManager contract, which can be triggered only by the trusted operator.
Function call analysis
insuranceFund.subBalance(settlement.settledAssetHash, settlement.insuranceTransferAmount);
External/Internal? Internal.
Argument control? All arguments are controlled by operator.
Impact: Decrease the balance of
insuranceFund
account byinsuranceTransferAmount
.
account.addBalance(settlement.settledAssetHash, settlement.insuranceTransferAmount);
External/Internal? Internal.
Argument control? All arguments are controlled by operator.
Impact: Increase the balance of account by
insuranceTransferAmount
.
position.chargeFundingFee(ledgerExecution.sumUnitaryFundings);
External/Internal? Internal.
Argument control?
ledgerExecution.sumUnitaryFundings
is controlled by caller.Impact: Charge funding fee.
position.isFullSettled()
External/Internal? Internal.
Argument control?: N/A.
Impact: Return true if
positionQty == 0
andcostPosition == 0
.