# Liquidations

In order for marginfi to remain solvent, the system employs multiple mechanisms to protect its accounts.

#### Liquidation

When a margin account no longer satisfies the maintenance margin requirement, the account is open for liquidation.

When an account is liquidated a liquidator can buy the entire UTP account at a discount (2.5%) to cover the liabilities of the liquidated account, the final settlement price received by the liquidated account its further discounted (5%), the difference funds the insurance fund.

Liquidators are just regular margin accounts, the with the only restriction that they cannot have any UTPs active.

Currently we haven't open sourced our liquidator bot yet, but we plan to in the very near future.\
If you are interested in participating in our early liquidator program, send us an email at <team@margin.services>

### Bankruptcies

If an account remains with outstanding liabilities and no access to further liquidate the account is *bankrupt*. The system handles bankruptcies in two ways.

1. The outstanding liabilities are covered from the insurance fund.
2. If the liabilities can't be entirely covered from the insurance fund the losses are socialized between lenders in the liquidity pool.

The bankruptcy handling system operates real time in marginfi in order to always have an accurate accounting of assets in the liquidity pool, and prevent any unrealized losses from skewing the lending mechanisms.


---

# 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://marginfi.gitbook.io/marginfi/protocol/margin-engine/liquidations.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.
