@algofi/lend
Version:
The official JavaScript SDK for the Algofi Lending Protocol
28 lines (27 loc) • 2.09 kB
TypeScript
import { SuggestedParams } from "algosdk";
import { TransactionGroup } from "../utils";
/**
* Returns a transaction group object representing a liquidation group
* transaction against the algofi protocol. The sender (liquidator) repays up to
* 50% of the liquidatee's outstanding borrow and takes collateral of the liquidatee
* at a premium defined by the market. The liquidator first sends borrow assets to the
* account address of the borrow market. Then, the account of the collateral market is authorized
* to credit the liquidator with a greater value of the liquidatee's collateral. The liquidator can
* then remove collateral to underlying to convert the collateral to assets.
*
* @param sender -account address for the sender
* @param suggestedParams - suggested transaction params
* @param storageAccount - storage account address for sender (liquidator)
* @param liquidateeStorageAccount - storage account address for liquidatee
* @param amount - amount of borrow the liquidator repays
* @param managerAppId - id of the manager application
* @param borrowMarketAppId - id of the borrow market application
* @param borrowMarketAddress - account address of the borrow market
* @param collateralMarketAppId - id of the collateral market application
* @param supportedMarketAppIds - list of supported market application ids
* @param supportedOracleAppIds - list of supported oracle application ids
* @param collateralBankAssetId - id of the collateral bank asset
* @param borrowAssetId - id of the borrow asset, defaults to algo
* @returns transaction group object representing a liquidate group transaction
*/
export declare function prepareLiquidateTransactions(sender: string, suggestedParams: SuggestedParams, storageAccount: string, liquidateeStorageAccount: string, amount: number, managerAppId: number, borrowMarketAppId: number, borrowMarketAddress: string, collateralMarketAppId: number, supportedMarketAppIds: number[], supportedOracleAppIds: number[], collateralBankAssetId: number, borrowAssetId?: number): TransactionGroup;