# Liquidation

In TownSquare, liquidation plays a critical role in protecting the system from bad debt. When borrowers’ positions become under-collateralized — often due to market fluctuations or growing interest — a liquidation mechanism is triggered to restore balance and secure the lending pool.\
\
**What Is Liquidation?**

Liquidation is the process where unhealthy loans (i.e., those that no longer meet collateral requirements) are partially or fully repaid by external actors known as **liquidators**. In return for taking on this risk, liquidators receive a portion of the borrower’s collateral as an incentive.

#### When Is a Loan Eligible for Liquidation?

A loan enters liquidation when the **borrowed value** exceeds the borrowable amount, typically due to:

* A drop in the value of the collateral,
* An increase in the borrowed amount from interest accrual,
* Or both.

In simple terms, if the collateral no longer provides enough safety buffer, the position is considered risky and can be liquidated.

#### Who Can Liquidate?

Anyone can act as a liquidator — including bots, users, or third-party services — as long as they can detect under-collateralized positions and have enough collateral in their own loan to cover the debt they intend to repay. This ensures that the liquidation can be executed fully and safely, preserving the stability of the protocol.

#### Liquidation Rewards, Debt Transfer & Protocol Fees

In the TownSquare protocol, a loan can contain **multiple borrowed assets** and **multiple collateral assets**, potentially **across different supported chains**.\
Liquidators therefore have the flexibility to decide:

* Which borrowed asset from the violator’s loan they want to repay
* Which collateral asset from the violator’s loan they want to seize

**How It Works**

1. **Asset Selection**
   * The violator may have borrowed assets like USDC, WETH, and MON, and collateral assets like ETH and DAI.
   * The liquidator must specify:
     * The **borrowed asset** they are repaying.
     * The **collateral asset** they are receiving.
2. **Debt Transfer**
   * When a liquidator repays part of a violator’s debt, the repaid amount is transferred from the violator’s loan to the liquidator’s loan. Since TownSquare supports cross-chain loans, this debt transfer is tracked within the protocol’s unified loan system, meaning the liquidator’s loan position can now include assets seized from the violator, regardless of the chain they reside on.
3. **Collateral Seizure with Bonus**
   * The liquidator receives in their loan the specified collateral from the violator’s loan.
   * A **liquidation bonus** ensures the collateral’s value exceeds the repayment.
   * Example: With a **10% bonus**, repaying $50 USDC earns $55 worth of ETH collateral.
4. **Profit & Fees**
   * The liquidator’s profit is the difference between collateral received and debt repaid.
   * The protocol takes a **liquidation fee** from the collateral seized.
   * Example: If $60 ETH is seized with a **15% fee**, $9 goes to the protocol, $51 stays with the liquidator.


---

# 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.townsq.xyz/technical-details/liquidation.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.
