> ## Documentation Index
> Fetch the complete documentation index at: https://rootsfi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquidation Manager

Dive into the mechanics of protocol stability with the Liquidation Manager. This contract plays a vital role in maintaining the health of the Roots ecosystem by efficiently managing the liquidation of undercollateralized Troves. Discover the functions that trigger and process liquidations, and the events that signal these critical actions.

## Functions

### `CCR()`

Returns the current Collateralization Ratio of the system. (View)

```solidity theme={null}
function CCR() -> uint256 [view]
```

### `DEBT_GAS_COMPENSATION()`

Returns the gas compensation amount for debt processing during liquidations. (View)

```solidity theme={null}
function DEBT_GAS_COMPENSATION() -> uint256 [view]
```

### `DECIMAL_PRECISION()`

Returns the decimal precision used in calculations. (View)

```solidity theme={null}
function DECIMAL_PRECISION() -> uint256 [view]
```

### `PERCENT_DIVISOR()`

Returns the divisor used for percentage calculations. (View)

```solidity theme={null}
function PERCENT_DIVISOR() -> uint256 [view]
```

### `batchLiquidateTroves`

Liquidates a batch of specified Troves for a given Trove Manager.

```solidity theme={null}
function batchLiquidateTroves(troveManager: address (contract ITroveManager), _troveArray: address[]) [nonpayable]
```

### `borrowerOperations()`

Returns the address of the `IBorrowerOperations` contract. (View)

```solidity theme={null}
function borrowerOperations() -> address (contract IBorrowerOperations) [view]
```

### `enableTroveManager`

Enables a Trove Manager for liquidation operations.

```solidity theme={null}
function enableTroveManager(_troveManager: address (contract ITroveManager)) [nonpayable]
```

### `factory()`

Returns the factory address. (View)

```solidity theme={null}
function factory() -> address [view]
```

### `liquidate`

Liquidates a single specified Trove for a given Trove Manager.

```solidity theme={null}
function liquidate(troveManager: address (contract ITroveManager), borrower: address) [nonpayable]
```

### `liquidateTroves`

Liquidates a maximum number of Troves for a given Trove Manager, up to a specified maximum Individual Collateralization Ratio (ICR).

```solidity theme={null}
function liquidateTroves(troveManager: address (contract ITroveManager), maxTrovesToLiquidate: uint256, maxICR: uint256) [nonpayable]
```

### `stabilityPool()`

Returns the address of the `IStabilityPool` contract. (View)

```solidity theme={null}
function stabilityPool() -> address (contract IStabilityPool) [view]
```

## Events

### `Liquidation`

Emitted when a liquidation occurs, detailing the amounts of debt and collateral liquidated, and gas compensations.

```solidity theme={null}
event Liquidation(_liquidatedDebt: uint256, _liquidatedColl: uint256, _collGasCompensation: uint256, _debtGasCompensation: uint256)
```

### `TroveLiquidated`

Emitted when a specific Trove is liquidated, including the borrower's address, debt, collateral, and the operation type.

```solidity theme={null}
event TroveLiquidated(_borrower: address, _debt: uint256, _coll: uint256, _operation: uint8)
```

### `TroveUpdated`

Emitted when a Trove is updated as a result of liquidation.

```solidity theme={null}
event TroveUpdated(_borrower: address, _debt: uint256, _coll: uint256, _stake: uint256, _operation: uint8)
```
