Peridot Protocol
  • Introduction
    • Overview
      • What is Peridot?
      • Our Mission & Vision
      • Key Value Propositions
    • Why Cross-Chain DeFi?
      • Current Challenges in DeFi
      • How our Hub & Spoke model addresses these challenges
  • Architecture & Design
    • System Architecture
      • Overview of the Hub & Spoke Model
    • Core Components
      • Compound Based Lending & Borrowing Modules
      • Wormhole Integration: Token Transfer with Payload
      • On-Chain Accounting & Interest Rate Models
    • Integration Details
  • Technical Specifications
    • Core Contracts
      • Peridottroller
      • PERC20
      • PEther
  • Easy Mode: Onramp & Offramp for New Users
    • Overview of Easy Mode
    • Goals
    • Key Features
  • Contact
Powered by GitBook
On this page
  1. Technical Specifications
  2. Core Contracts

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.

PreviousCore ContractsNextPERC20

Last updated 1 month ago