Returns the current per-block supply interest rate for this vToken
Return Values
Name
Type
Description
[0]
uint256
The supply interest rate per block, scaled by 1e18
borrowRatePerBlock
Returns the current per-block borrow interest rate for this vToken
Return Values
Name
Type
Description
[0]
uint256
The borrow interest rate per block, scaled by 1e18
getCash
Get cash balance of this vToken in the underlying asset
Return Values
Name
Type
Description
[0]
uint256
The quantity of underlying asset owned by this contract
setReduceReservesBlockDelta
Governance function to set new threshold of block difference after which funds will be sent to the protocol share reserve
Parameters
Name
Type
Description
newReduceReservesBlockDelta_
uint256
block difference value
setProtocolShareReserve
Sets protocol share reserve contract address
Parameters
Name
Type
Description
protcolShareReserve_
address payable
The address of protocol share reserve contract
initialize
Initialize the money market
Parameters
Name
Type
Description
comptroller_
contract ComptrollerInterface
The address of the Comptroller
interestRateModel_
contract InterestRateModelV8
The address of the interest rate model
initialExchangeRateMantissa_
uint256
The initial exchange rate, scaled by 1e18
name_
string
EIP-20 name of this token
symbol_
string
EIP-20 symbol of this token
decimals_
uint8
EIP-20 decimal precision of this token
exchangeRateCurrent
Accrue interest then return the up-to-date exchange rate
Return Values
Name
Type
Description
[0]
uint256
Calculated exchange rate scaled by 1e18
accrueInterest
Applies accrued interest to total borrows and reserves
_setComptroller
Sets a new comptroller for the market
Return Values
Name
Type
Description
[0]
uint256
uint Returns 0 on success, otherwise returns a failure code (see ErrorReporter.sol for details).
_setInterestRateModel
Accrues interest and updates the interest rate model using _setInterestRateModelFresh
Parameters
Name
Type
Description
newInterestRateModel_
contract InterestRateModelV8
The new interest rate model to use
Return Values
Name
Type
Description
[0]
uint256
uint Returns 0 on success, otherwise returns a failure code (see ErrorReporter.sol for details).
exchangeRateStored
Calculates the exchange rate from the underlying to the VToken
Return Values
Name
Type
Description
[0]
uint256
Calculated exchange rate scaled by 1e18
borrowBalanceStored
Return the borrow balance of account based on stored data
Parameters
Name
Type
Description
account
address
The address whose balance should be calculated
Return Values
Name
Type
Description
[0]
uint256
The calculated balance
transferOutUnderlyingFlashLoan
Transfers the underlying asset to the specified address for flash loan operations.
Can only be called by the Comptroller contract. This function performs the actual transfer of the underlying asset and tracks the flash loan amount.
Parameters
Name
Type
Description
to
address payable
The address to which the underlying asset is transferred
amount
uint256
The amount of the underlying asset to transfer
transferInUnderlyingFlashLoan
Transfers the underlying asset from the specified address for flash loan repayment.
Can only be called by the Comptroller contract. This function performs the actual transfer of the underlying asset for flash loan repayment and handles protocol fee distribution to the protocol share reserve.
Parameters
Name
Type
Description
from
address payable
The address from which the underlying asset is transferred
repaymentAmount
uint256
The amount of the underlying asset to transfer
totalFee
uint256
The total fee amount for the flash loan
protocolFee
uint256
The protocol fee amount to be transferred to the protocol share reserve
Return Values
Name
Type
Description
[0]
uint256
The actual amount transferred in
calculateFlashLoanFee
Calculates the total fee and protocol fee for a flash loan amount. Reverts if flash loans are disabled.
Parameters
Name
Type
Description
amount
uint256
The amount of the flash loan
Return Values
Name
Type
Description
[0]
uint256
The total fee for the flash loan
[1]
uint256
The portion of the total fees that goes to the protocol share reserve
setFlashLoanEnabled
Sets flash loan status for the market. Governance-restricted.
Parameters
Name
Type
Description
enabled
bool
True to enable flash loans, false to disable
Return Values
Name
Type
Description
[0]
uint256
Status code (e.g., success/failure)
setFlashLoanFeeMantissa
Updates the flash loan fee parameters. Governance-restricted.