InterestRateModel
InterestRateModel
Dynamic interest rate model implementation
Model stores some Silo specific data. If model is replaced, it needs to set proper config after redeployment for seamless service. Please refer to separte litepaper about model for design details.
Methods
DP
DP is 18 decimal points used for integer calculations
Returns
RCOMP_MAX
maximum value of compound interest the model will return
Returns
X_MAX
maximum value of X for which, RCOMP_MAX should be returned
Returns
acceptOwnership
Transfers ownership of the contract to a pending owner Can only be called by the pending owner.
calculateCompoundInterestRate
pure function that calculates interest rate based on raw input data
Parameters
Returns
calculateCurrentInterestRate
pure function that calculates current annual interest rate
Parameters
Returns
config
Parameters
Returns
getCompoundInterestRate
get compound interest rate
Parameters
Returns
getCompoundInterestRateAndUpdate
get compound interest rate and update model storage
Parameters
Returns
getConfig
Get config for giver asset in a Silo. If dedicated config is not set, default one will be returned.
Parameters
Returns
getCurrentInterestRate
get current annual interest rate
Parameters
Returns
interestRateModelPing
just a helper method to see if address is a InterestRateModel
Returns
owner
Returns the address of the current owner.
Returns
pendingOwner
Returns the address of the pending owner.
Returns
renounceOwnership
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
setConfig
Set dedicated config for giver asset in a Silo. Config is per asset per Silo so different assets in different Silo can have different configs.
Parameters
transferOwnership
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
transferPendingOwnership
Transfers pending ownership of the contract to a new account (newPendingOwner
). Can only be called by the current owner.
Parameters
Events
ConfigUpdate
Emitted on config change
Parameters
OwnershipPending
Emitted when ownership transfer is proposed, aka pending owner is set
Parameters
OwnershipTransferred
Emitted when ownership is transferred on transferOwnership
and acceptOwnership
Parameters
Last updated