Search…
Liquidation
The liquidation mechanism ensures the protocol’s safety by liquidating undercollateralized debts.
A loan position is liquidated when the users' borrow balance
$BB_ t$
is greater than or equal to the under-collateralization threshold, as a result, the Liquidation Margin is equal to zero.

## Liquidation Margin

The Liquidation Margin is an index that has been designed to make sure the user understands how close liquidation is. The Liquidation Margin of a certain borrow is expressed at each time
$t$
as follows:
$LM_t =1- \frac{BB_t}{T _t}$
Where:
$T_t=A_t*S2*R_{\frac{BorrowedAsset}{DepositedAsset}_t}$
$R_{\frac{BorrowedAsset}{DepositedAsset}_t}$
is the ratio between the borrowed and deposited asset value.
• $BB_t$
represents the borrow balance of the user, which is composed of the borrowed amount, plus the accrued and unpaid interests.
The Liquidation margin should give you an indication of how close you are to being liquidated. The closer the value is to zero the closer the liquidation

## Liquidators

The liquidators are bots used by third parties that detect the undercollateralized position and liquidate them. The liquidation can be operated on the whole amount of the loan position or just a part of it. Liquidators are incentivized to purchase the collateral at a lower price at the borrower's expense.
Folks Finance runs the community liquidators. The total profits from this operation are deposited into the community treasury.
An open-source SDK package is published on the official Folks Finance GitHub to allow anyone to build their own liquidator.

### Example

Due to collateral fluctuation or unpaid interest, the Liquidation Margin reaches the value of zero. So, the liquidator: