📚
INIT Capital Developer Docs
  • Overview
  • Core Contracts
  • Guides
    • Basic Interaction
      • Deposit and Withdraw
      • Create Position
      • Add and Remove Collateral
      • Borrow and Repay
      • Changing Position Mode
    • Advanced Interaction
      • Liquidate Position
      • Flashloan
      • Multicall
      • Callback
    • Liquidity Hook
      • Multicall with Callback
      • Money Market Hook
      • Looping Hook
      • Margin Trading Hook
  • Contract References
    • InitCore
    • PosManager
    • LendingPool
    • Config
    • RiskManager
    • InitOracle
    • LiqIncentiveCalculator
    • DoubleSlopeIRM
    • InitErrors
    • MoneyMarketHook
    • LoopingHook
    • MarginTradingHook
  • Contract Addresses
    • Blast
    • Mantle
Powered by GitBook
On this page
  • View Functions
  • core
  • underlyingToken
  • cash
  • totalDebt
  • totalDebtShares
  • irm
  • lastAccruedTime
  • reserveFactor_e18
  • treasury
  • decimals
  • debtAmtToShareStored
  • debtShareToAmtStored
  • toShares
  • toAmt
  • getBorrowRate_e18
  • getSupplyRate_e18
  • totalAsset
  • External Functions
  • accrueInterest
  • debtAmtToShareCurrent
  • debtShareToAmtCurrent
  • toSharesCurrent
  • toAmtCurrent
  1. Contract References

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.

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

irm

Interest rate model contract address of lending pool.

function irm() external view returns (address interestRateModel);

lastAccruedTime

Last stored timestamp that accrue borrow interest.

function lastAccruedTime() external view returns (uint256 lastAccruedTimestamp);

reserveFactor_e18

Reserve factor in 10^18 precision.

function reserveFactor_e18() external view returns (uint256 factor);

treasury

INIT treasury contract address.

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

decimals

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

function decimals() external view returns (uint256 decimal);

debtAmtToShareStored

function debtAmtToShareStored(uint _amt) external view returns (uint shares);

debtShareToAmtStored

function debtShareToAmtStored(uint _shares) external view returns (uint amt);

toShares

function toShares(uint _amt) external view returns (uint shares);

toAmt

function toAmt(uint _shares) external view returns (uint amt);

getBorrowRate_e18

Get current borrow interest in 10^18 precision.

function getBorrowRate_e18() external view returns (uint borrowRate_e18);

getSupplyRate_e18

Get current supply interest in 10^18 precision.

function getSupplyRate_e18() external view returns (uint supplyRate_e18);

totalAsset

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

function totalAssets() external view returns (uint totalAsset);

External Functions

accrueInterest

Accrue borrow interest and update last accrued timestamp.

function accrueInterest() external;

debtAmtToShareCurrent

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

function debtAmtToShareCurrent(uint256 _amt) external returns (shares);

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).

function debtShareToAmtCurrent(uint _shares) external returns (uint amt);

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).

This is not a view function.

function toSharesCurrent(uint _amt) external returns (uint shares);

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).

This is not a view function.

function toAmtCurrent(uint _shares) external returns (uint amt);

Parameters:

Name
Type
Description

_shares

uint256

inToken amount to convert

Returns:

Name
Type
Description

amt

uint256

corresponding underlying token amount after accrue interest

PreviousPosManagerNextConfig

Last updated 1 year ago

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

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

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

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

debtAmtToShareCurrent
debtShareToAmtCurrent
toShareCurrent
toAmtCurrent