Function prepareLiquidateLoan
- prepareLiquidateLoan(
loanAppId: number,
poolManagerAppId: number,
liquidatorAddr: string,
escrowAddr: string,
reserveAddr: string,
collateralPool: Pool,
borrowPool: Pool,
oracle: Oracle,
lpAssets: LPToken[],
baseAssetIds: number[],
repayAmount: number | bigint,
minCollateralAmount: number | bigint,
isStable: boolean,
params: SuggestedParams,
): Transaction[] Parameters
- loanAppId: number
loan application to repay borrow in
- poolManagerAppId: number
pool manager application
- liquidatorAddr: string
account address for the liquidator
- escrowAddr: string
account address for the loan escrow
- reserveAddr: string
account address to receive the protocol revenue from the percentage of the accrued interest
- collateralPool: Pool
pool to seize collateral of
- borrowPool: Pool
pool to repay borrow of
- oracle: Oracle
oracle application to retrieve asset prices from
- lpAssets: LPToken[]
list of lp assets in loan
- baseAssetIds: number[]
list of base asset ids in loan (non-lp assets)
- repayAmount: number | bigint
amount of borrow to repay expressed in terms of borrow pool asset
- minCollateralAmount: number | bigint
minimum collateral amount for the liquidator to receive expressed in terms of collateral pool f asset
- isStable: boolean
whether the borrow that is being repaid is a stable or variable rate borrow
- params: SuggestedParams
suggested params for the transactions with the fees overwritten
Returns Transaction[]
Transaction[] liquidate group transaction
- loanAppId: number
Returns a group transaction to repay borrow in a loan escrow using assets sent from user.