# Liquidation

When the total borrowed $$TB\_t$$ exceeds the borrowable amount $$BA\_t$$, the loan can be liquidated by a third party:

$$
TB\_t>BA\_t
$$

When a third party liquidates a loan, they select a single borrow to repay and a single collateral to seize. The maximum amount $$C$$, they can liquidate is given as a percentage $$liquidation.max$$ (e.g. 50%) of the borrow balance $$BB\_t$$​:

$$
C\leqslant	BB\_t\*liquidation.max
$$

To incentivise third parties to liquidate other users’ under-collateralized loans, a liquidation bonus $$liq.bonus$$ is earned. If there is insufficient balance of the chosen collateral, then at most the full collateral balance will be seized.

A portion of the liquidation bonus is kept by the protocol as revenue, as determined by the liquidation fee $$liq.fees$$, Any remaining collateral that is not retained by the protocol, will be earned by the liquidator.
