# Liquidating a Borrower

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:

```solidity
/// @notice Computes liquidation parameters and updates debt position
/// @param token Collateral token to seize
/// @param asset Debt asset to repay
/// @param debtToCover Amount of asset to repay
/// @param account Account to liquidate
/// @return Amount Liquidated
function liquidate(
    address token,
    address asset,
    uint256 debtToCover,
    address account
) external returns (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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cryndex-labs.gitbook.io/cryndex-docs/developers/liquidating-a-borrower.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
