# Liquidator Contract

The **`LiquidatorContract.sol`** smart contract facilitates liquidations by interacting with the Bonzo lending pool and performing token swaps via SaucerSwap.

### 1. Review the Contract

You can find the contract code [here](https://github.com/Bonzo-Labs/bonzo-finance-contracts/blob/main/contracts/examples/LiquidationContract.sol).

**Key Functions:**

* **`liquidate()`**: Initiates the flash loan and triggers the liquidation.
* **`executeOperation()`**: Called after receiving the flash-loaned amount; performs the liquidation and token swap.
* **`_associateToken()`**: Associates Hedera tokens with the contract (required on Hedera).

### 2. Compile the Contract

Compile the contract using Hardhat:

```bash
npm run compile
```

### 3. Deploy the Contract

Deploy the contract to the Hedera testnet:

```bash
npx hardhat run scripts/deploy.ts --network hedera_testnet
```

* Ensure your **`hardhat.config.ts`** is set up for the Hedera testnet.
* In **`deploy.ts`**, replace **`LendingPoolAddressesProvider_address`** and **`SaucerswapRouter_address`** with the actual contract addresses.


---

# 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://docs.bonzo.finance/hub/developer/bonzo-lend/liquidation-bots-beta/liquidator-contract.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.
