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

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.


These functions enable secure management and governance of Peridot Protocol's lending operations and risk parameters.

Last updated