pub fn liquidate_borrow<T: Config>(
    borrower: T::AccountId,
    liquidation_asset_id: <T as Config>::CurrencyId,
    repay_amount: <T as Config>::Balance,
    collateral_asset_id: <T as Config>::CurrencyId
)
Expand description

The caller liquidates the borrower’s collateral. This extrinsic may need to be called multiple times to completely clear the borrower’s bad debt, because of the close_factor parameter in the market. See the close_factor_may_require_multiple_liquidations_to_clear_bad_debt unit test for an example of this.

  • borrower: the borrower to be liquidated.
  • liquidation_asset_id: the underlying asset to be liquidated.
  • repay_amount: the amount of liquidation_asset_id to be repaid. This parameter can only be as large as the close_factor market parameter allows (close_factor * borrower_debt_in_liquidation_asset).
  • collateral_asset_id: The underlying currency whose lend tokens to seize from the borrower. Note that the liquidator has to redeem the received lend tokens from the market to convert them to collateral_asset_id.

Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::liquidate_borrow.