Function calculateLiquidationAmounts

  • Calculates liquidation amount and corresponding collateral amount

    Parameters

    • loanAsset: PoolAssetConfig

      loan asset pool config

    • collateralAsset: PoolAssetConfig

      collateral asset pool config

    • supplyAmount: bigint

      user total supply worth amount

    • borrowAmount: bigint

      user total borrow worth amount

    • principalsDict: Dictionary<bigint, bigint>

      user principals

    • pricesDict: Dictionary<bigint, bigint>

      assets prices

    • assetsDataDict: ExtendedAssetsData

      assets data collection

    • assetsConfigDict: ExtendedAssetsConfig

      assets config collection

    • masterConstants: MasterConstants

      evaa master contract constants

    Returns { maxCollateralRewardAmount: bigint; maxLiquidationAmount: bigint }

    maxLiquidationAmount max loan asset amount to transfer