Documentation
    Preparing search index...
    • Create a liquidation transaction in the PTB (Programmable Transaction Block)

      This function allows liquidators to liquidate a borrower's position by repaying their debt in exchange for their collateral. The liquidation process uses flash loans to ensure atomic execution of the liquidation transaction.

      Parameters

      • tx: Transaction

        The transaction block to add the liquidation operation to

      • payAsset: AssetIdentifier

        Asset identifier for the debt being repaid

      • payCoinObject: CoinObject

        Coin object containing the debt repayment amount

      • collateralAsset: AssetIdentifier

        Asset identifier for the collateral being liquidated

      • liquidateAddress: string | TransactionResult

        Address of the borrower being liquidated

      • Optionaloptions: Partial<EnvOption>

        Optional environment configuration

      Returns Promise<{ $kind: "NestedResult"; NestedResult: [number, number] }[]>

      Tuple containing [collateralBalance, remainDebtBalance] where: - collateralBalance: The collateral received from liquidation - remainDebtBalance: Any remaining debt after liquidation

      Error if either pay asset or collateral asset does not support flash loans