> For the complete documentation index, see [llms.txt](https://guide.dem.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.dem.exchange/earn/nitron-lend-and-borrow/liquidation/partial-liquidations.md).

# Partial Liquidations

## Overview

In the event of liquidation, not all of the user's collateral may always be liquidated. The maximum amount of collateral that can be liquidated (and therefore repaid debt is determined by:&#x20;

* [Health Factor](/earn/nitron-lend-and-borrow/borrowing.md#health-factor): The collateralization level of the borrower's position (e.g. ratio of the value of the collateral to the outstanding debt)
* Close Factor: The maximum percentage of the borrower's collateral that can be liquidated in the event of default.

## Calculation

To determine the maximum collateral that can be liquidated, we must first find the Close Factor of the position.&#x20;

### Close Factor&#x20;

Mathematically, the Close Factor is a number that scales linearly between a Minimum Close Factor (e.g. 0.1) and 1.0. The maximum value of 1.0 is reached when the Borrowed Value has reached a critical value ("Critical Borrowed Value"), which is between between initial Liquidation Threshold and the Collateral Value. This means that the position has passed its Complete Liquidation Threshold.

The Critical Borrowed Value is defined as:&#x20;

B = LT + (CV-LT) \* CLT, where

* B = Critical Borrowed Value;&#x20;
* CV = Collateral Value;
* LT = Liquidation Threshold;
* CLT = Complete Liquidation Threshold; the CLT determines how far between LT and CV a borrower’s borrowed value must have progressed to allow a full liquidation. For example, 0.3 indicates 30% of the way from LT to CV.

There is a special case where Close Factor is always 1.0 if the Borrowed Value is less than the Small Liquidation Size, as long as the borrower is eligible for liquidation, so that small underwater positions can be easily completely removed.&#x20;

### Liquidation Amount

The [Close Factor](#close-factor) is then multiplied by the value of the borrower's collateral to determine the maximum amount of collateral that can be liquidated.

## Example

Suppose:

* Loan to Value (LTV) = 85% or 0.85;
* Liquidation Threshold = 88% or 0.88;
* Liquidation Bonus = 5% or 0.05;
* Liquidation Bonus Fee = 10% or 0.10;&#x20;
* Minimum Close Factor = 0.10;
* Close Factor = Variable factor; The close factor determines the percentage of the borrower's collateral that can be liquidated.&#x20;

A borrower provides $100,000 in USDC and borrows $85,000 in ATOM (max LTV).

| Collateral                                                                               | $100,000 in USDC                                              |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| Borrowings                                                                               | $85,000 in ATOM                                               |
| Loan to Value (LTV)                                                                      | 85% < Liquidation Threshold                                   |
| <p>Health Factor </p><p>= (Collateral Value \* Liquidation Threshold) / Borrow Value</p> | <p>= (100,000 \* 0.88) / 85,000</p><p>= 1.03529</p><p>> 1</p> |

The value of the borrowed ATOM increases to $92,500, bringing the user’s LTV ratio to 95.2% (thus exceeding the Liquidation Threshold of 88%).&#x20;

| Collateral                                                                               | $100,000 in USDC                                              |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| Borrowings                                                                               | $92,500 in ATOM                                               |
| Loan to Value (LTV)                                                                      | 92.5% > Liquidation Threshold                                 |
| <p>Health Factor </p><p>= (Collateral Value \* Liquidation Threshold) / Borrow Value</p> | <p>= (100,000 \* 0.88) / 92,000</p><p>= 0.95652</p><p>< 1</p> |

The borrower will be liquidated to ensure their position remains over-collateralized.

The exact calculation is as follows:

1. **Find Close Factor**

Critical Borrowed Value (B)

\= LT + (CV-LT) \* CLT

\= $88,000 + ($100,000 - $88,000) \* 0.7

\= $96,400

Close Factor = 1 when Borrowed Value hits the critical amount of $96,400.&#x20;

Close Factor (CF)

\= (Debt - LT) / (CV - LT) \* (1 - Minimum CF) + Minimum CF

\= (92,500 - 88,000) / (100,000-88,000) \* (1-0.1) + 0.1

\= 0.4375

<figure><img src="/files/bxTAYzmQVoveBfutxEV9" alt=""><figcaption><p>Relationship between Close Factor and Borrow Value</p></figcaption></figure>

2. **Calculate Maximum Liquidation Amount**

The maximum amount that can be liquidated&#x20;

\= Close Factor \* Debt (e.g. Current value of borrowings in USD)&#x20;

\= 0.4375 \* $92,500&#x20;

\= $40468.75

The maximum amount that can be liquidated is $40468.75. The liquidator can initiate a liquidation and sell up to $40468.75 in collateral to repay the outstanding debt.

In return, the liquidator should expect to receive $40,468.75 \* 1.045 =  $42289.84 worth of the collateral after repaying the debt.


---

# 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://guide.dem.exchange/earn/nitron-lend-and-borrow/liquidation/partial-liquidations.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.
