> For the complete documentation index, see [llms.txt](https://peridot-finance.gitbook.io/peridot-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://peridot-finance.gitbook.io/peridot-protocol/technical-architecture/evm/core-contracts/peridottroller.md).

# Peridottroller

The **Peridottroller** is the main contract responsible for controlling protocol-wide operations, managing collateral settings, borrowing rules, market management, and enforcing liquidation logic.

***

### 🛠️ Key Functions & Parameters

#### &#x20;`enterMarkets(address[] calldata pTokens)`

Allows a user to use specified markets' assets as collateral.

* **Parameters:**
  * `pTokens`: Array of pToken addresses the user wishes to enter as collateral.

***

#### `exitMarket(address pToken)`

Removes a market's asset from user's collateral.

* **Parameters:**
  * `pToken`: Address of the market token the user wishes to exit from collateral.

***

#### `getAccountLiquidity(address account)`

Calculates the user's current account liquidity.

* **Parameters:**
  * `account`: Address of the user.
* **Returns:**
  * User's liquidity and shortfall status (excess collateral or shortfall amount).

***

#### `liquidateBorrow(address borrower, uint repayAmount, address pTokenCollateral)`

Allows liquidation of an undercollateralized borrower's position.

* **Parameters:**
  * `borrower`: Address of the borrower to liquidate.
  * `repayAmount`: Amount of debt to repay on behalf of the borrower.
  * `pTokenCollateral`: The collateral token to seize.

***

#### `markets(address pToken)`

Returns market details (collateral factor, listed status, etc.) for a specific token market.

* **Parameters:**
  * `pToken`: Market token address.
* **Returns:**
  * Struct containing market configuration, collateral factors, and status.
