# Liquidation Penalty

*Goals:*  \
&#x20;*- liquidation is lucrative for liquidator,*\
&#x20;*- liquidation improves health of the borrower;*

Given

$$
health = 1 - bcu/bc\\
$$

for

* deposited asset A worth of *d* with collateral factor $$cf\_{A}$$,
* borrowed asset B worth of *b* with liquidation threshold $$lt\_{B}$$

Liquidation starts when

$$
h\_0 = 1 - \frac{(b/lt\_B)}{(d*cf\_A)} = 1 - \frac{b}{d*cf\_A*lt\_B} = 0,\\
\Downarrow\\
d/b = 1/(cf\_A*lt\_B)
$$

Upon liquidation of portion $$\alpha$$ of B with penalty $$p\_A$$, health must increase:

$$
h\_1 = 1 - \frac{(b(1-\alpha))}{cf\_A*lt\_B*(d-\alpha \* b (1 + p\_B))} > h\_0 = 0\ \Downarrow\ b(1-\alpha) < cf\_A*lt\_B*(d-\alpha \* b (1 + p\_B))\ \Downarrow\ (1-\alpha) < cf\_A*lt\_B*((d/b)-\alpha \* (1 + p\_B))\ 1 - \alpha < 1- \alpha \* (1 + p\_B) \* cf\_A*lt\_B \ \alpha > \alpha \* (1 + p\_B) \* cf\_A*lt\_B\ (1 + p\_B) \* cf\_A*lt\_B < 1\ (1 + p\_B) < \frac{1}{cf\_A*lt\_B}\ \Downarrow\ p\_B <\frac{1}{cf\_A\*lt\_B} - 1
$$

is the condition for liquidation to increase health. Given $$max(cf)=0.9$$​

$$
p <\frac{1}{0.9\*lt} - 1
$$

&#x20;is then a safe condition for liquidation penalty for any asset.


---

# 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.vires.finance/knowledgebase/liquidation-penalty.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.
