Assessment reports>Orderly Network>Threat Model>executeLiquidation

Function: executeLiquidation(EventTypes.Liquidation liquidation, uint64 eventId)

Function that facilitates the execution of a liquidation action.

struct Liquidation { bytes32 liquidatedAccountId; - ID of the account whose position will be liquidated. bytes32 insuranceAccountId; - The account that will get insurance funds from `accountId`. bytes32 liquidatedAssetHash; - The hash of the token will be liquidated. uint128 insuranceTransferAmount; - It will be transferred from the `liquidatedAccountId` balance to the `insuranceAccountId`. uint64 timestamp; - It is not used. LiquidationTransfer[] liquidationTransfers; } struct LiquidationTransfer { bytes32 liquidatorAccountId; bytes32 symbolHash; int128 positionQtyTransfer; int128 costPositionTransfer; int128 liquidatorFee; int128 insuranceFee; int128 liquidationFee; uint128 markPrice; int128 sumUnitaryFundings; uint64 liquidationTransferId; }

Function call analysis

  • _transferLiquidatedAssetToInsurance(liquidatedAccount,

    liquidation.liquidatedAssetHash,liquidation.insuranceTransferAmount,

    liquidation.insuranceAccountId

    • External/Internal? Internal.

    • Argument control? All arguments are controlled by operator.

    • Impact: Decrease the liquidatedAccount balance by insuranceTransferAmount and increase the balance of insuranceAccountId.

  • _liquidatorLiquidateAndUpdateEventId

    • External/Internal? Internal.

    • Argument control? All arguments are controlled by operator.

    • Impact: Decrease the liquidatedAccount balance by insuranceTransferAmount and increase the balance of insuranceAccountId.

Zellic © 2024Back to top ↑