Types

Git Source

Author: Morpho Labs.

Common types and structs used in Morpho contracts.

Structs

SupplyBalance

STRUCTS ///

struct SupplyBalance {
    uint256 inP2P;
    uint256 onPool;
}

BorrowBalance

struct BorrowBalance {
    uint256 inP2P;
    uint256 onPool;
}

Indexes

struct Indexes {
    uint256 p2pSupplyIndex;
    uint256 p2pBorrowIndex;
    uint256 poolSupplyIndex;
    uint256 poolBorrowIndex;
}

MaxGasForMatching

struct MaxGasForMatching {
    uint64 supply;
    uint64 borrow;
    uint64 withdraw;
    uint64 repay;
}

Delta

struct Delta {
    uint256 p2pSupplyDelta;
    uint256 p2pBorrowDelta;
    uint256 p2pSupplyAmount;
    uint256 p2pBorrowAmount;
}

AssetLiquidityData

struct AssetLiquidityData {
    uint256 collateralUsd;
    uint256 maxDebtUsd;
    uint256 debtUsd;
    uint256 underlyingPrice;
    uint256 collateralFactor;
}

LiquidityData

struct LiquidityData {
    uint256 collateralUsd;
    uint256 maxDebtUsd;
    uint256 debtUsd;
}

LastPoolIndexes

struct LastPoolIndexes {
    uint32 lastUpdateBlockNumber;
    uint112 lastSupplyPoolIndex;
    uint112 lastBorrowPoolIndex;
}

MarketParameters

struct MarketParameters {
    uint16 reserveFactor;
    uint16 p2pIndexCursor;
}

MarketStatus

struct MarketStatus {
    bool isCreated;
    bool isPaused;
    bool isPartiallyPaused;
}

MarketPauseStatus

struct MarketPauseStatus {
    bool isSupplyPaused;
    bool isBorrowPaused;
    bool isWithdrawPaused;
    bool isRepayPaused;
    bool isLiquidateCollateralPaused;
    bool isLiquidateBorrowPaused;
    bool isDeprecated;
}

Enums

PositionType

ENUMS ///

enum PositionType {
    SUPPLIERS_IN_P2P,
    SUPPLIERS_ON_POOL,
    BORROWERS_IN_P2P,
    BORROWERS_ON_POOL
}