> For the complete documentation index, see [llms.txt](https://docs.hann.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hann.finance/protocol/borrowing-and-liquidation.md).

# Borrowing and liquidation

Open a USDHN loan, manage collateral and debt, and reclaim collateral after repayment or liquidation.

A **Trove** holds your collateral and records your USDHN debt. Opening a Trove locks collateral in the selected market and sends newly minted USDHN to your wallet. You keep the position open until you repay and close it, or it is liquidated. There is no fixed maturity date.

Selling, swapping, or spending the USDHN leaves the debt in your Trove. Closing requires repayment of the latest debt, including accrued interest and fees.

![KAIA collateral is locked in a Trove to borrow USDHN; repayment releases the collateral.](https://2221521122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8nyFCptMbCTgKUyVYlHX%2Fuploads%2Fgit-blob-1a8cb8661b99ff67b60303c1c1675ab942c2bcfc%2Fcollateral-borrow.svg?alt=media)

## Open a USDHN loan

1. Connect your wallet and open the USDHN borrowing screen. Keep KAIA available for the network fee and the refundable gas deposit.
2. Select your asset in **Collateral** and enter the amount to deposit. Each collateral market, called a **branch**, has its own token, price feed, pools, and borrowing parameters.
3. Enter the USDHN amount in **Loan**. Check the borrowing rate, upfront fee, projected debt, LTV, and liquidation price. **Expert Mode** opens the interest-rate controls for automatic or manual management.
4. Select **Borrow** and review the amounts and refundable gas deposit. For token collateral, complete the spending approval or permit signature requested by the wallet. Native KAIA does not require an ERC-20 spending approval.
5. Confirm the borrowing transaction in your wallet. After the transaction succeeds, USDHN is sent to your wallet and the position appears in your loans.

The contract checks the debt floor, collateral ratio, branch status, oracle, and branch-wide collateral ratio when the transaction executes. An input that passes the screen's preview can still fail if these values change before execution.

## Collateral ratio and liquidation price

The **collateral ratio (CR)** compares collateral value with USDHN debt:

$$
CR = \frac{\text{collateral amount} \times \text{branch oracle price}}{\text{USDHN debt}}
$$

For this calculation, one USDHN of debt is valued at $1. The debt includes accrued interest and pending redistribution amounts. **LTV**, the loan-to-value ratio shown in the app, is the reciprocal: `LTV = 1 / CR`.

| Change                         | Effect on CR, with other values unchanged |
| ------------------------------ | ----------------------------------------- |
| Collateral price falls         | CR falls.                                 |
| Borrow more or accrue interest | CR falls.                                 |
| Withdraw collateral            | CR falls.                                 |
| Add collateral or repay USDHN  | CR rises.                                 |

**MCR** is the branch's minimum collateral ratio. Liquidation becomes available when the current CR is **below MCR**. Batched loans must also meet the additional **BCR** buffer when opening or adjusting. Use the selected branch's parameters and the current position values; thresholds from another collateral market do not apply.

The liquidation price is the collateral price at which the position reaches MCR. Interest, new borrowing, repayment, and collateral changes move this price. A higher CR creates more room for a collateral price decline. The calculations and worked examples are in [Collateral ratio and repayment](/mechanics/deep-dives/cdp-safety.md).

## Costs and debt

| Item                   | How it is charged                                                                                                                                          |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Upfront borrowing fee  | Added to debt when opening or increasing a loan. It equals seven days of interest on the newly borrowed amount at the branch's quoted average annual rate. |
| Borrowing interest     | Accrues at the position's annual rate and increases the amount to repay.                                                                                   |
| Batch management fee   | Accrues for a loan enrolled with an interest batch manager. Check the manager's annual fee and rate before joining.                                        |
| Early rate-change fee  | Rate changes during the seven-day adjustment cooldown incur an upfront fee. Review the quote before confirming.                                            |
| Refundable gas deposit | Paid in KAIA when opening. It is returned on voluntary closure; liquidation pays it to the liquidator.                                                     |
| Network fee            | Paid to process approvals and transactions. It is separate from the refundable deposit.                                                                    |

Your wallet receives the requested USDHN amount. The upfront fee is added to the debt, so the opening debt exceeds the amount received.

## Adjust a loan

Open the position to see its current collateral, total debt, rate, LTV, and liquidation price.

| Position control          | Action                                         | Result                                                                               |
| ------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------ |
| **Collateral → Deposit**  | Add collateral.                                | Collateral increases without new borrowing.                                          |
| **Collateral → Withdraw** | Remove collateral within the permitted amount. | Collateral falls and LTV rises.                                                      |
| **Loan → Repay**          | Enter the USDHN amount to repay.               | USDHN is burned and debt falls.                                                      |
| **Loan → Borrow**         | Enter an additional USDHN amount.              | New USDHN is sent to your wallet; debt increases by that amount and the upfront fee. |
| **Interest rate**         | Change the rate or management mode.            | The new rate or batch manager applies after the transaction.                         |

Review the resulting debt, collateral, and fees before completing the wallet approvals and transaction. Partial repayment keeps the loan at or above `MIN_DEBT`; the contract reduces an excessive repayment request to that limit. Use the closing action for full repayment.

[Redemptions](/protocol/redemptions-and-risk.md) can reduce both a loan's collateral and debt. A redemption that leaves debt below `MIN_DEBT` puts the position into `zombie` status. The position still holds its remaining collateral. Its recovery action raises debt to the minimum and adds the collateral needed to meet the borrowing constraints; closure settles the remaining debt and returns the collateral.

## Repay and close

1. Open your position and select **Repay & close**. The review shows the latest USDHN amount to repay and the collateral to return.
2. Hold enough USDHN to repay that amount. If the balance is short, **Close options** shows the shortfall and the actions to swap for USDHN or close with collateral.
3. Complete the manager authorization and USDHN spending approval or permit signature shown in the transaction flow, then confirm the closing transaction.
4. After success, the debt is settled, the remaining collateral and refundable gas deposit are returned, and the Trove NFT is burned.

**Close with collateral** uses part of the position's collateral to obtain USDHN and repay the debt. Review the flash-loan fee, swap conditions, and expected collateral return. Fees, slippage, and price changes reduce the collateral returned. The [Zapper guide](/protocol/zapper.md) covers this transaction path.

Before branch shutdown, closing must leave the branch's total collateral ratio at or above **CCR**, and the last remaining Trove cannot be closed. The app displays the reason when closure is blocked. After shutdown, voluntary closure remains available and these two closure restrictions are lifted.

## Branch restrictions

| Branch state | Borrowing and adjustments                                                                                                                                            |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Pending`    | New loans and collateral/debt adjustments are blocked.                                                                                                               |
| `Active`     | Operations follow the position and branch collateral-ratio requirements.                                                                                             |
| `Deprecated` | New loans and net debt increases are blocked. Existing loans can be reduced or closed within the other contract rules.                                               |
| Shutdown     | New borrowing and ordinary adjustments, including partial repayment, stop. Full repayment and closure remain available. Interest accrual stops at the shutdown time. |

**TCR** is the total collateral ratio of the branch. Below CCR, additional borrowing must restore TCR to at least CCR, and a collateral withdrawal requires repayment of at least the withdrawn collateral's oracle value. A breach of the shutdown threshold **SCR**, or a qualifying oracle failure, triggers branch shutdown.

## Liquidation and remaining collateral

Anyone can submit a liquidation transaction for an eligible position. The contract uses the branch oracle price and the latest collateral and debt to check `CR < MCR`.

1. The Trove is closed and its NFT is burned.
2. The branch's **Stability Pool** uses deposited USDHN to offset debt and receives the corresponding collateral after liquidation charges.
3. Debt that the pool cannot offset, and its allocated collateral, are redistributed to the other live Troves in the same branch.
4. The liquidator receives the gas deposit and the applicable collateral compensation. Liquidation penalties reduce the borrower's collateral return.
5. Any surplus collateral is recorded for the borrower in `CollSurplusPool`.

Open the liquidated loan to see the liquidation amounts. If **Remaining collateral** is positive, connect the borrower's wallet and select **Claim remaining collateral**. Confirm the claim transaction to receive it. A zero surplus leaves no collateral to claim.

Liquidation uses the position's collateral; it does not automatically take other wallet balances. USDHN already in your wallet remains there. Other Troves in the same branch can receive redistributed debt and collateral, so their values can change during liquidation. [Troves and collateral branches](/mechanics/deep-dives/trove-concepts.md) explains these relationships.

Adding collateral or repaying USDHN raises CR. Borrowing more, withdrawing collateral, and accumulating interest lower it. Track the current position rather than its opening values, including oracle updates and [redemption effects](/protocol/redemptions-and-risk.md). [Liquidations and Earn](/mechanics/deep-dives/liquidations-and-earn.md) describes the Stability Pool accounting, and [USDHN and Earn](/protocol/usdhn-and-earn.md) covers deposits into that pool.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hann.finance/protocol/borrowing-and-liquidation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
