LendingPool

INIT lending pool contract.

View Functions

core

InitCore contract address.

function core() external view returns (address initCore);

underlyingToken

Underlying token of the lending pool.

function underlyingToken() external view returns (address underlyingToken);

cash

Current liquidity available for borrow.

function cash() external view returns (uint256 amt);

totalDebt

Last stored total borrowed amount of underlying token amount, including borrow interest.

function totalDebt() external view returns (uint256 totalDebt);

totalDebtShares

Last stored total debt shares.

irm

Interest rate model contract address of lending pool.

lastAccruedTime

Last stored timestamp that accrue borrow interest.

reserveFactor_e18

Reserve factor in 10^18 precision.

treasury

INIT treasury contract address.

decimals

inToken decimal (currently equals to8 + underlyingToken.decimals()).

debtAmtToShareStored

Convert debt amount to debt shares (rounded up) without interest accrual. For interest accrual, use debtAmtToShareCurrent.

debtShareToAmtStored

Convert debt amount to debt shares (rounded up) without interest accrual. For interest accrual, use debtShareToAmtCurrent.

toShares

Convert the underlying token amount to inToken amount (rounded down) without interest accrual. For interest accrual, use toShareCurrent.

toAmt

Convert inToken amount to underlying token amount (rounded down) without interest accrual. For interest accrual, use toAmtCurrent.

getBorrowRate_e18

Get current borrow interest in 10^18 precision.

getSupplyRate_e18

Get current supply interest in 10^18 precision.

totalAsset

Get the total underlying token amount lent into the lending pool, including borrow interest since last accrued timestamp.

External Functions

accrueInterest

Accrue borrow interest and update last accrued timestamp.

debtAmtToShareCurrent

Accrue interest and convert debt amount to debt shares (rounded up).

Parameters:

Name
Type
Description

_amt

uint256

debt amount to convert to debt shares

Returns:

Name
Type
Description

shares

uint256

corresponding debt shares after accrue interest

debtShareToAmtCurrent

Accrue interest and convert debt shares to debt amount (rounded up).

Parameters:

Name
Type
Description

_shares

uint256

debt shares to convert to debt amount

Returns:

Name
Type
Description

amt

uint256

corresponding debt amount after accrue interest

toSharesCurrent

Accrue borrow interest and convert the underlying token amount to inToken amount (rounded down).

Parameters:

Name
Type
Description

_amt

uint256

underlying token amount to convert

Returns:

Name
Type
Description

shares

uint256

corresponding inToken amount after accrue interest

toAmtCurrent

Accrue borrow interest and convert the inToken amount to the underlying token amount (rounded down).

Parameters:

Name
Type
Description

_shares

uint256

inToken amount to convert

Returns:

Name
Type
Description

amt

uint256

corresponding underlying token amount after accrue interest

Last updated