PoolConfigurator

Git Source

Inherits: Adminable, VersionedInitializable, IPoolConfigurator, PoolConfiguratorStorage

See the documentation in {IPoolConfigurator}.

State Variables

HUNDRED_PERCENT

uint256 public constant HUNDRED_PERCENT = 1_000_000;

POOL_CONFIGURATOR_REVISION

uint256 public constant POOL_CONFIGURATOR_REVISION = 0x1;

ADDRESSES_PROVIDER

IPoolAddressesProvider public immutable ADDRESSES_PROVIDER;

Functions

whenNotPaused

modifier whenNotPaused();

onlyAdminOrGovernor

modifier onlyAdminOrGovernor();

onlyGovernor

modifier onlyGovernor();

onlyPool

modifier onlyPool();

constructor

constructor(IPoolAddressesProvider provider_);

getRevision

Returns the revision number of the contract

Needs to be defined in the inherited class as a constant.

function getRevision() internal pure virtual override returns (uint256 revision_);

Returns

NameTypeDescription

revision_

uint256

The revision number

initialize

The initializer function for the pool configurator (must be called straight after deployment)

function initialize(
    IPoolAddressesProvider provider_,
    address poolAdmin_,
    address asset_,
    string memory name_,
    string memory symbol_
)
    external
    override
    initializer;

Parameters

NameTypeDescription

provider_

IPoolAddressesProvider

The address of the pool addresses provider.

poolAdmin_

address

The address of the pool admin

asset_

address

The funds asset used in the pool (e.g. DAI, USDC)

name_

string

The name of the asset

symbol_

string

The symbol of the asset

transferAdmin

function transferAdmin(address newAdmin_) external override(Adminable, IAdminable) onlyGovernor;

setBuyer

assigns a pool buyer to the pool

function setBuyer(address buyer_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

buyer_

address

The address of the buyer for this pool

setValidSeller

Sets the status of a seller

function setValidSeller(address seller_, bool isValid_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

seller_

address

The address of the seller

isValid_

bool

Whether the seller is valid

setValidLender

Sets the status of a lender (LPs)

function setValidLender(address lender_, bool isValid_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

lender_

address

The address of the lender

isValid_

bool

Whether the lender is valid

setAdminFee

Sets the admin fee rate that would be applied to the pool

function setAdminFee(uint24 adminFee_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

adminFee_

uint24

The new admin fee

setOpenToPublic

Sets whether the pool is open to the public (permissioned or permissionless)

function setOpenToPublic(bool isOpenToPublic_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

isOpenToPublic_

bool

Whether the pool is open to the public

setGracePeriod

Sets the grace period for the pool

function setGracePeriod(uint32 gracePeriod_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

gracePeriod_

uint32

The new grace period

requestFunds

Request funds from the pool and fund the loan manager

function requestFunds(uint256 principal_) external override whenNotPaused;

Parameters

NameTypeDescription

principal_

uint256

The amount of principal to request

triggerDefault

Triggers the defaults of a specific loan in the loan manager

function triggerDefault(uint16 loanId_) external override whenNotPaused onlyAdminOrGovernor;

Parameters

NameTypeDescription

loanId_

uint16

The ID of the defaulted loan

requestRedeem

Requests to redeem shares

function requestRedeem(uint256 shares_, address owner_, address sender_) external override whenNotPaused onlyPool;

Parameters

NameTypeDescription

shares_

uint256

The amount of shares to redeem

owner_

address

The owner of the shares

sender_

address

The sender of the request

processRedeem

Processes the redemption of shares for a specific owner

function processRedeem(
    uint256 shares_,
    address owner_,
    address sender_
)
    external
    override
    whenNotPaused
    onlyPool
    returns (uint256 redeemableShares_, uint256 resultingAssets_);

Parameters

NameTypeDescription

shares_

uint256

The amount of shares to redeem

owner_

address

The owner of the shares

sender_

address

The sender of the process request

Returns

NameTypeDescription

redeemableShares_

uint256

The amount of redeemable shares

resultingAssets_

uint256

The corresponding amount of assets with the redeemable shares

removeShares

Removes shares from its withdrawal request

function removeShares(
    uint256 shares_,
    address owner_
)
    external
    override
    whenNotPaused
    onlyPool
    returns (uint256 sharesReturned_);

Parameters

NameTypeDescription

shares_

uint256

The amount of shares to remove from withdrawal

owner_

address

The owner of the shares

Returns

NameTypeDescription

sharesReturned_

uint256

The amount of shares returned

depositCover

Pool admin deposits pool cover

function depositCover(uint256 amount_) external override whenNotPaused;

Parameters

NameTypeDescription

amount_

uint256

The amount of assets to deposit as first-loss cover

withdrawCover

Pool admin withdraws from pool cover

function withdrawCover(uint256 amount_, address recipient_) external override whenNotPaused onlyAdmin;

Parameters

NameTypeDescription

amount_

uint256

The amount of assets to withdraw from first-loss cover

recipient_

address

The address of the recipient

openToPublic

Returns whether the pool is open to public

function openToPublic() external view override returns (bool openToPublic_);

Returns

NameTypeDescription

openToPublic_

bool

Whether the pool is open to public

adminFee

Returns the admin fee of the pool

function adminFee() external view override returns (uint24 adminFee_);

Returns

NameTypeDescription

adminFee_

uint24

The admin fee of the pool

gracePeriod

Returns the grace period of the pool

function gracePeriod() external view override returns (uint32 gracePeriod_);

Returns

NameTypeDescription

gracePeriod_

uint32

The grace period of the pool

maxDeposit

Returns the max deposit amount of a receiver

function maxDeposit(address receiver_) external view virtual override returns (uint256 maxAssets_);

Parameters

NameTypeDescription

receiver_

address

The address of the receiver

Returns

NameTypeDescription

maxAssets_

uint256

The max amount of assets that can be deposited

maxMint

Returns the max mint amount of a receiver

function maxMint(address receiver_) external view virtual override returns (uint256 maxShares_);

Parameters

NameTypeDescription

receiver_

address

The address of the receiver

Returns

NameTypeDescription

maxShares_

uint256

The max amount of shares that can be minted

maxRedeem

Returns the max redeem amount of an owner

function maxRedeem(address owner_) external view virtual override returns (uint256 maxShares_);

Parameters

NameTypeDescription

owner_

address

The address of the owner

Returns

NameTypeDescription

maxShares_

uint256

The max amount of shares that can be redeemed

previewRedeem

Previews the amount of assets that can be redeemed for the amount of shares specified

function previewRedeem(address owner_, uint256 shares_) external view virtual override returns (uint256 assets_);

Parameters

NameTypeDescription

owner_

address

The address of the owner

shares_

uint256

The amount of shares to redeem

Returns

NameTypeDescription

assets_

uint256

The amount of assets that would be received

totalAssets

Returns the total amount of assets in the pool

function totalAssets() external view override returns (uint256 totalAssets_);

Returns

NameTypeDescription

totalAssets_

uint256

The total amount of assets in the pool

hasSufficientCover

Returns whether the pool currently has sufficient cover

function hasSufficientCover() external view override returns (bool hasSufficientCover_);

Returns

NameTypeDescription

hasSufficientCover_

bool

Whether the pool currently has sufficient cover

unrealizedLosses

Returns the current amount of unrealized losses of the pool

function unrealizedLosses() external view override returns (uint256 unrealizedLosses_);

Returns

NameTypeDescription

unrealizedLosses_

uint256

The current amount of unrealized losses of the pool

_totalAssets

function _totalAssets() internal view returns (uint256 totalAssets_);

_revertIfPaused

function _revertIfPaused() internal view;

_revertIfNotAdminOrGovernor

function _revertIfNotAdminOrGovernor() internal view;

_revertIfNotGovernor

function _revertIfNotGovernor() internal view;

_revertIfNotPool

function _revertIfNotPool() internal view;

_hasSufficientCover

function _hasSufficientCover(IIsleGlobals globals_) internal view returns (bool hasSufficientCover_);

_handleCover

function _handleCover(uint256 losses_) internal;

_min

function _min(uint256 a_, uint256 b_) internal pure returns (uint256 min_);

_getMaxAssets

function _getMaxAssets(address receiver_, uint256 totalAssets_) internal view returns (uint256 maxAssets_);

_globals

function _globals() internal view returns (IIsleGlobals globals_);

_loanManager

function _loanManager() internal view returns (ILoanManager loanManager_);

_withdrawalManager

function _withdrawalManager() internal view returns (IWithdrawalManager withdrawalManager_);

Last updated