The Pool is an ERC-4626 compliant contract that manages liquidity for lending to credit managers and earning interest.
View Functions
underlyingToken
function underlyingToken() external view returns (address)
Returns the underlying token address.
The underlying token address
treasury
function treasury() external view returns (address)
Returns the treasury address.
withdrawFee
function withdrawFee() external view returns (uint16)
Returns the withdrawal fee in basis points.
Withdrawal fee in basis points
creditManagers
function creditManagers() external view returns (address[] memory)
Returns all connected credit managers.
Array of credit manager addresses
availableLiquidity
function availableLiquidity() external view returns (uint256)
Returns the amount of available liquidity.
Amount of available liquidity
expectedLiquidity
function expectedLiquidity() external view returns (uint256)
Returns the expected liquidity (available + borrowed).
Expected liquidity amount
expectedLiquidityLU
function expectedLiquidityLU() external view returns (uint256)
Returns the expected liquidity at last update.
Expected liquidity at last update
ERC-4626 Lending
depositWithReferral
function depositWithReferral(
uint256 assets,
address receiver,
uint256 referralCode
) external returns (uint256 shares)
Deposits assets with a referral code.
Amount of assets to deposit
Address to receive shares
Referral code for tracking
mintWithReferral
function mintWithReferral(
uint256 shares,
address receiver,
uint256 referralCode
) external returns (uint256 assets)
Mints shares with a referral code.
Address to receive shares
Referral code for tracking
Amount of assets deposited
Borrowing
totalBorrowed
function totalBorrowed() external view returns (uint256)
Returns the total amount borrowed by all credit managers.
totalDebtLimit
function totalDebtLimit() external view returns (uint256)
Returns the total debt limit across all credit managers.
creditManagerBorrowed
function creditManagerBorrowed(address creditManager) external view returns (uint256)
Returns the amount borrowed by a specific credit manager.
The credit manager address
Amount borrowed by the credit manager
creditManagerDebtLimit
function creditManagerDebtLimit(address creditManager) external view returns (uint256)
Returns the debt limit for a specific credit manager.
The credit manager address
Debt limit for the credit manager
creditManagerBorrowable
function creditManagerBorrowable(address creditManager) external view returns (uint256 borrowable)
Returns how much a credit manager can still borrow.
The credit manager address
Amount the credit manager can still borrow
lendCreditAccount
function lendCreditAccount(
uint256 borrowedAmount,
address creditAccount
) external
Lends funds to a credit account.
The credit account to lend to
repayCreditAccount
function repayCreditAccount(
uint256 repaidAmount,
uint256 profit,
uint256 loss
) external
Repays debt from a credit account.
Interest Rate
interestRateModel
function interestRateModel() external view returns (address)
Returns the interest rate model address.
The interest rate model contract address
baseInterestRate
function baseInterestRate() external view returns (uint256)
Returns the current base interest rate.
Base interest rate in ray units
supplyRate
function supplyRate() external view returns (uint256)
Returns the supply rate for lenders.
baseInterestIndex
function baseInterestIndex() external view returns (uint256)
Returns the current base interest index.
Base interest index in ray units
baseInterestIndexLU
function baseInterestIndexLU() external view returns (uint256)
Returns the base interest index at last update.
Base interest index at last update
lastBaseInterestUpdate
function lastBaseInterestUpdate() external view returns (uint40)
Returns the timestamp of last base interest update.
Unix timestamp of last update
Quotas
poolQuotaKeeper
function poolQuotaKeeper() external view returns (address)
Returns the pool quota keeper address.
The pool quota keeper contract address
quotaRevenue
function quotaRevenue() external view returns (uint256)
Returns the quota revenue.
lastQuotaRevenueUpdate
function lastQuotaRevenueUpdate() external view returns (uint40)
Returns the timestamp of last quota revenue update.
Unix timestamp of last update
updateQuotaRevenue
function updateQuotaRevenue(int256 quotaRevenueDelta) external
Updates quota revenue by a delta amount.
Change in quota revenue (can be negative)
setQuotaRevenue
function setQuotaRevenue(uint256 newQuotaRevenue) external
Sets quota revenue to a specific value.
Configuration
setInterestRateModel
function setInterestRateModel(address newInterestRateModel) external
Sets a new interest rate model.
New interest rate model contract address
setPoolQuotaKeeper
function setPoolQuotaKeeper(address newPoolQuotaKeeper) external
Sets a new pool quota keeper.
New pool quota keeper contract address
setTotalDebtLimit
function setTotalDebtLimit(uint256 newLimit) external
Sets a new total debt limit.
setCreditManagerDebtLimit
function setCreditManagerDebtLimit(
address creditManager,
uint256 newLimit
) external
Sets debt limit for a specific credit manager.
The credit manager address
New debt limit for the credit manager
setWithdrawFee
function setWithdrawFee(uint256 newWithdrawFee) external
Sets a new withdrawal fee.
New withdrawal fee in basis points
pause
function pause() external
Pauses the pool.
unpause
function unpause() external
Unpauses the pool.