Liquidations are vital for Cryndex, as they protect the protocol's integrity if a loan becomes undercollateralised. Liquidators are motivated by bonus tokens obtained from borrowers. Each collateral token offers a unique bonus incentive. You can check the bonus for each collateral token by using the getLiquidationBonus(address token) on the treasury.
In order to liquidate a borrower, a liquidator must use the liquidate function on the treasury:
/// @notice Computes liquidation parameters and updates debt position/// @paramtoken Collateral token to seize/// @paramasset Debt asset to repay/// @paramdebtToCover Amount of asset to repay/// @paramaccount Account to liquidate/// @returnAmount Liquidatedfunctionliquidate(addresstoken,addressasset,uint256debtToCover,addressaccount)externalreturns(uint256);
A liquidator can pay back a maximum of 50% of a borrower's debt in exchange for a 1:1 ratio of the borrowers collateral. A borrower can only be liquidated if their health factor drops below 1, you can check the health factor of a borrower by using the calculateHealthFactor(address account) function on the treasury.
If you want to check the collateral balance of an account you can use the getCollateralBalance(address account, address token) function and to check the debt balance you can use the getDebtBalance(address account, address asset) function. Both of these functions exist on the treasury.