MoCInrate
Last updated
Last updated
View Source:
↗ Extends: , , , , ,
MoCInrate - version: 0.1.10
Constants & Variables
Parameters
amount
uint256
daysToSettlement
uint256
nReserveBucketC0
uint256
Parameters
amount
uint256
nReserveBucketC0BeforePay
uint256
Arguments
Arguments
Arguments
_stableTmin
uint256
Arguments
_stableTmax
uint256
Arguments
_stablePower
uint256
Arguments
Arguments
Arguments
Calculates an average interest rate between after and before free stableToken Redemption
Returns
Interest rate value [using mocPrecision]
Arguments
stableTokenRedeem
uint256
StableTokens to redeem [using mocPrecision]
Initializes the contract
Arguments
connectorAddress
address
MoCConnector contract address
_governor
address
Governor contract address
riskProxTmin
uint256
Minimum interest rate [using mocPrecision]
riskProxPower
uint256
Power is a parameter for interest rate calculation [using noPrecision]
riskProxTmax
uint256
Maximun interest rate [using mocPrecision]
_riskProRate
uint256
BitPro holder interest rate [using mocPrecision]
blockSpanRiskPro
uint256
BitPro blockspan to configure payments periods[using mocPrecision]
riskProInterestTargetAddress
address payable
Target address to transfer the weekly BitPro holders interest
commissionsAddressTarget
address payable
Target addres to transfer commissions of mint/redeem
_stableTmin
uint256
Upgrade to support red stable inrate parameter
_stablePower
uint256
Upgrade to support red stable inrate parameter
_stableTmax
uint256
Upgrade to support red stable inrate parameter
gets tMin param of RiskProx tokens
Returns
returns tMin of RiskProx
Arguments
gets tMax param of RiskProx tokens
Returns
returns tMax of RiskProx
Arguments
gets power param of RiskProx tokens
Returns
returns power of RiskProx
Arguments
⤾ overrides IMoCInrate.getRiskProInterestBlockSpan
Gets the blockspan of RiskPro that represents the frecuency of RiskPro holders intereset payment
Returns
returns power of riskProInterestBlockSpan
Arguments
sets tMin param of RiskProx tokens
Arguments
_btxcTmin
uint256
tMin of RiskProx
sets tMax param of RiskProx tokens
Arguments
_btxcTax
uint256
tMax of RiskProx
sets power param of RiskProx tokens
Arguments
_btxcPower
uint256
power of RiskProx
⤾ overrides IMoCInrate.getRiskProRate
Gets the rate for RiskPro Holders
Returns
RiskPro Rate
Arguments
Sets RiskPro Holders rate
Arguments
newRiskProRate
uint256
New RiskPro rate
⤾ overrides IMoCInrate.setRiskProInterestBlockSpan
Sets the blockspan RiskPro Intereset rate payment is enable to be executed
Arguments
newRiskProBlockSpan
uint256
New RiskPro Block span
⤾ overrides IMoCInrate.getRiskProInterestAddress
Gets the target address to transfer RiskPro Holders rate
Returns
Target address to transfer RiskPro Holders interest
Arguments
Sets the target address to transfer RiskPro Holders rate
Arguments
newRiskProInterestAddress
address payable
New RiskPro rate
Sets the target address to transfer commissions of Mint/Redeem transactions
Arguments
newCommissionsAddress
address payable
New commisions address
Calculates interest rate for RiskProx Minting, redeem and Free StableToken Redeem
Returns
Interest rate value [using RatePrecsion]
Arguments
Calculates an average interest rate between after and before mint/redeem
Returns
Interest rate value [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket involved in the operation
resTokensAmount
uint256
Value of the operation from which calculates the inrate [using reservePrecision]
onMinting
bool
Value that represents if the calculation is based on mint or on redeem
returns the amount of ReserveTokens to pay in concept of interest to bucket C0
Arguments
⤾ overrides IMoCInrate.calcMintInterestValues
Extract the inrate from the passed ReserveTokens value for RiskProx minting operation
Returns
ReserveTokens to pay in concept of interests [using reservePrecision]
Arguments
bucket
bytes32
Bucket to use to calculate interés
reserveTokenAmount
uint256
Total value from which extract the interest rate [using reservePrecision]
⤾ overrides IMoCInrate.calcStableTokenRedInterestValues
Extract the inrate from the passed ReserveTokens value for the StableToken Redeem operation
Returns
finalInterest
Arguments
stableTokenAmount
uint256
StableToken amount of the redemption [using mocPrecision]
reserveTokenAmount
uint256
Total value from which extract the interest rate [using reservePrecision]
⤾ overrides IMoCInrate.calcFinalRedeemInterestValue
This function calculates the interest to return to the user in a RiskProx redemption. It uses a mechanism to counteract the effect of free stableTokens redemption. It will be replaced with FreeStableToken redemption interests in the future
Returns
Reserves to recover in concept of interests [using reservePrecision]
Arguments
bucket
bytes32
Bucket to use to calculate interest
reserveTokenToRedeem
uint256
Total value from which calculate interest [using reservePrecision]
DEPRECATED calculates the Commission rate from the passed RBTC amount for mint/redeem operations
Returns
finalCommissionAmount [using reservePrecision]
Arguments
reserveTokenAmount
uint256
Total value from which apply the Commission rate [using reservePrecision]
⤾ overrides IMoCInrate.calcCommissionValue
calculates the Commission rate from the passed ReserveTokens amount for mint/redeem operations
Returns
finalCommissionAmount [using reservePrecision]
Arguments
reserveTokenAmount
uint256
Total value from which apply the Commission rate [using reservePrecision]
txType
uint8
Transaction type according to constant values defined in this contract
⤾ overrides IMoCInrate.calculateVendorMarkup
calculates the vendor markup rate from the passed vendor account and amount
Returns
finalCommissionAmount [using reservePrecision]
Arguments
vendorAccount
address
Vendor address
amount
uint256
Total value from which apply the vendor markup rate [using reservePrecision]
Calculates ReserveTokens value to return to the user in concept of interests
Returns
Reserves to recover in concept of interests [using reservePrecision]
Arguments
bucket
bytes32
Bucket to use to calculate interest
reserveTokenToRedeem
uint256
Total value from which calculate interest [using reservePrecision]
⤾ overrides IMoCInrate.dailyInratePayment
Moves the daily amount of interest rate to C0 bucket
Arguments
⤾ overrides IMoCInrate.isDailyEnabled
Arguments
⤾ overrides IMoCInrate.isRiskProInterestEnabled
Arguments
⤾ overrides IMoCInrate.calculateRiskProHoldersInterest
Calculates RiskPro Holders interest rates
Returns
toPay interest in ReserveTokens [using reservePrecsion]
Arguments
⤾ overrides IMoCInrate.payRiskProHoldersInterestPayment
Pays the RiskPro Holders interest rates
Returns
interest payed in ReserveTokens [using reservePrecsion]
Arguments
Sets the commission rate to a particular transaction type
Arguments
txType
uint8
Transaction type according to constant values defined in this contract
value
uint256
Commission rate
Calculates the interest rate to pay until the settlement day
Returns
Interest rate value [using mocPrecision]
Arguments
inrate
uint256
Spot interest rate
countAllDays
bool
Value that represents if the calculation will use all days or one day less
This function calculates the interest to return to a user redeeming RiskProx as a proportion of the amount in the interestBag.
Returns
InterestsInBag * (RedeemInterests / FullRedeemInterest) [using reservePrecision]
Arguments
bucket
bytes32
Bucket to use to calculate interest
redeemInterest
uint256
Total value from which calculate interest [using reservePrecision]
This function calculates the interest to return if a user redeem all RiskProx in existance
Returns
Interests [using reservePrecision]
Arguments
bucket
bytes32
Bucket to use to calculate interest
Calculates the final amount of Bucket 0 StableTokens on RiskProx mint/redeem
Returns
Final bucket 0 StableToken amount
Arguments
bucket
bytes32
Name of the bucket involved in the operation
resTokensAmount
uint256
Value of the operation from which calculates the inrate [using reservePrecision]
onMinting
bool
Returns the days to use for interests calculation
Returns
days [using dayPrecision]
Arguments
countAllDays
bool
Value that represents if the calculation is based on mint or on redeem
Initialize the contracts with which it interacts
Arguments
Initialize the parameters of the contract
Arguments
_governor
address
the address of the IGovernor contract
riskProxMin
uint256
Minimum interest rate [using mocPrecision]
riskProxPower
uint256
Power is a parameter for interest rate calculation [using noPrecision]
riskProxMax
uint256
Maximun interest rate [using mocPrecision]
_riskProRate
uint256
RiskPro holder interest rate [using mocPrecision]
commissionsAddressTarget
address payable
blockSpanRiskPro
uint256
RiskPro blockspan to configure payments periods[using mocPrecision]
riskProInterestsTarget
address payable
Target address to transfer the weekly RiskPro holders interest
_stableTmin
uint256
Upgrade to support red stable inrate parameter
_stablePower
uint256
Upgrade to support red stable inrate parameter
_stableTmax
uint256
Upgrade to support red stable inrate parameter
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⚠ This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.