# Liquidation

When a user's borrowing balance surpasses their total collateral value (i.e., their borrowing capacity) — either because the value of their collateral has decreased or the value of the borrowed assets has risen — the system allows for liquidation.&#x20;

This process is executed through the public function `liquidate(address target, address collateralAsset, address borrowAsset, uint closeAmount)`. By invoking this function, the liquidator exchanges their own assets for a portion of the borrower’s collateral at a price slightly more favorable than the prevailing market rate. This mechanism incentivizes liquidators while maintaining the platform's stability by addressing under-collateralized positions.

If an account’s outstanding borrowing exceeds its borrowing capacity, a portion of the borrowed amount can be repaid in exchange for the borrower’s collateral. This exchange occurs at the current market price, reduced by a liquidation discount, which serves as an incentive for arbitrageurs to act promptly. By stepping in, they help reduce the borrower’s exposure and mitigate the protocol’s risk.

The amount eligible for repayment is determined by the _close factor_, which specifies the portion of the borrowed asset that can be repaid at a time. The close factor typically ranges between 0 and 1 (e.g., 25%). The liquidation process can be repeatedly triggered until the borrower’s outstanding balance falls below their borrowing capacity.

Any Ethereum address holding the borrowed asset can initiate the liquidation by invoking the relevant function, exchanging their asset for the borrower’s collateral. Since all users, assets, and price data are fully integrated within the protocol, the liquidation process is seamless and does not depend on external systems or order books.
