Liquidation
Methods to Participate
There are multiple ways to participate in liquidations:
Manually call
liquidateBorrow
methods in pToken contractsDevelop a liquidation bot which can work as an automatic system for handling liquidation
Prerequisites for Liquidation
Before making a liquidation call, you must:
Identify the Borrower: Know the borrower's wallet address who is under collateralized
Understand the Debt Position:
Know the borrower’s outstanding debt, including the type of asset and amount eligible for repayment.
Ensure you have a sufficient balance of the repaying asset
Identify the Collateral: Know the collateral asset you’re closing
How to gather the required information above?
Monitor User Positions
Usually, you can build off-chain bots tracking all users’ positions to see who is eligible to liquidate, as well as know what their collateral and debt assets are. These bots could continuously query the blockchain for updates on user positions
Query Protocol Contracts to access protocol-specific parameters:
Liquidation Incentives: The discount offered to liquidators for seizing collateral.
Close Factor: The maximum proportion of the debt that can be repaid in a single liquidation event.
Liquidation Fee: A small proportion of the collateral seizure to be shared with the protocol, which varies on the collateral assets
Executing liquidation
On the contract’s address of the borrowed asset’s pToken that represents the debt asset you are going to repay, call liquidateBorrow
When making a liquidation call, provide accurate parameters to comply with protocol rules:
repayAmount
: Specify the amount of debt to repay. This must be within the limit determined by the protocol's Close Factor, which caps the maximum repayable debt in a single transaction.pTokenCollateral
: This is the pToken of the borrowers supplied asset you wish to seize during liquidation.
Note: Make sure you have approved a sufficient token spending allowance for the asset before calling liquidationBorrow
Last updated