MoCState
Last updated
Last updated
View Source:
↗ Extends: , , , ↘ Derived Contracts:
MoCState - version: 0.1.10
Constants & Variables
Parameters
newState
enum IMoCState.States
Parameters
oldAddress
address
newAddress
address
Parameters
oldAddress
address
newAddress
address
Parameters
mocTokenAddress
address
Parameters
mocVendorsAddress
address
Initializes the contract
Arguments
params
struct MoCState.InitializeParams
Params defined in InitializeParams struct
Sets the max discount rate.
Arguments
rate
uint256
Discount rate at liquidation level [using mocPrecision]
return the value of the RiskPro max discount rate configuration param
Returns
riskProMaxDiscountRate RiskPro max discount rate
Arguments
Defines how many blocks there are in a day
Arguments
blockSpan
uint256
blocks there are in a day
Sets a new PriceProvider contract
Arguments
priceProviderAddress
address
address of the price provider contract
Gets the PriceProviderAddress
Returns
address of the price provider contract
Arguments
Gets how many blocks there are in a day
Returns
blocks there are in a day
Arguments
⤾ overrides IMoCState.substractFromReserves
Subtract the reserve amount passed by parameter to the reserves total
Arguments
amount
uint256
Amount that will be subtract to reserves
⤾ overrides IMoCState.addToReserves
Add the reserve amount passed by parameter to the reserves total
Arguments
amount
uint256
Amount that will be added to reserves
All RiskPros in circulation
Arguments
All stableTokens in circulation
Arguments
Target coverage for complete system
Arguments
Amount of ReserveTokens in the system excluding RiskProx values and interests holdings
Arguments
⤾ overrides IMoCState.globalCoverage
GLOBAL Coverage
Returns
coverage [using mocPrecision].
Arguments
BUCKET lockedReserveTokens
Returns
lockedReserveTokens amount [using reservePrecision].
Arguments
bucket
bytes32
Name of the bucket used
Gets ReserveTokens in RiskPro within specified bucket
Returns
ReserveToken amount of RiskPro in Bucket [using reservePrecision].
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.getReservesRemainder
Gets the ReserveTokens in the contract that not corresponds to StableToken collateral
Returns
ReserveTokens remainder [using reservePrecision].
Arguments
⤾ overrides IMoCState.coverage
BUCKET Coverage
Returns
coverage [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.abundanceRatio
Abundance ratio, receives tha amount of stableToken to use the value of stableToken0 and StableToken total supply
Returns
abundance ratio [using mocPrecision]
Arguments
stableToken0
uint256
⤾ overrides IMoCState.currentAbundanceRatio
Relation between stableTokens in bucket 0 and StableToken total supply
Returns
abundance ratio [using mocPrecision]
Arguments
⤾ overrides IMoCState.leverage
BUCKET Leverage
Returns
leverage [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket used
GLOBAL maxStableToken
Returns
maxStableToken to issue [using mocPrecision]
Arguments
⤾ overrides IMoCState.freeStableToken
Returns the amount of stableTokens in bucket 0, that can be redeemed outside of settlement
Returns
amount of stableTokens in bucket 0, that can be redeemed outside of settlement [using mocPrecision]
Arguments
BUCKET maxStableToken
Returns
maxStableToken to issue [using mocPrecision]
Arguments
bucket
bytes32
GLOBAL maxRiskPro
Returns
maxRiskPro for redeem [using mocPrecision].
Arguments
⤾ overrides IMoCState.absoluteMaxStableToken
ABSOLUTE maxStableToken
Returns
maxStableToken to issue [using mocPrecision]
Arguments
BUCKET maxRiskPro to redeem / mint
Returns
maxRiskPro for redeem [using mocPrecision].
Arguments
bucket
bytes32
Name of the bucket used
GLOBAL max riskProx to mint
Returns
maxRiskProx [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.maxRiskProxResTokenValue
GLOBAL max riskProx to mint
Returns
maxRiskProx ReserveTokens value to mint [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.absoluteMaxRiskPro
ABSOLUTE maxRiskPro
Returns
maxStableToken to issue [using mocPrecision].
Arguments
⤾ overrides IMoCState.maxRiskProWithDiscount
DISCOUNT maxRiskPro
Returns
maxRiskPro for mint with discount [using mocPrecision]
Arguments
GLOBAL lockedReserveTokens
Returns
lockedReserveTokens amount [using reservePrecision].
Arguments
⤾ overrides IMoCState.riskProTecPrice
ReserveTokens price of RiskPro
Returns
the RiskPro Tec Price [using reservePrecision].
Arguments
⤾ overrides IMoCState.bucketRiskProTecPrice
BUCKET ReserveTokens price of RiskPro
Returns
the RiskPro Tec Price [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.bucketRiskProTecPriceHelper
BUCKET ReserveTokens price of RiskPro (helper)
Returns
the RiskPro Tec Price [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.riskProDiscountPrice
ReserveTokens price of RiskPro with spot discount applied
Returns
the RiskPro Tec Price [using reservePrecision].
Arguments
RiskPro USD PRICE
Returns
the RiskPro USD Price [using mocPrecision]
Arguments
GLOBAL max riskProx to mint
Returns
max RiskPro allowed to be spent to mint RiskProx [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
BUCKET RiskProx price in RiskPro
Returns
RiskPro RiskPro Price [[using mocPrecision]Precision].
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.riskProSpotDiscountRate
GLOBAL ReserveTokens Discount rate to apply to RiskProPrice.
Returns
RiskPro discount rate [using DISCOUNT_PRECISION].
Arguments
⤾ overrides IMoCState.daysToSettlement
Calculates the number of days to next settlement based dayBlockSpan
Returns
days to next settlement
Arguments
Number of blocks to settlement
Returns
Number of blocks to settlement
Arguments
Verifies if forced liquidation is reached checking if globalCoverage <= liquidation (currently 1.04) and if liquidation is enabled
Returns
true if liquidation state is reached, false otherwise
Arguments
⤾ overrides IMoCState.getLiquidationPrice
Returns the price to use for stableToken redeem in a liquidation event
Returns
price to use for stableToken redeem in a liquidation event
Arguments
⤾ overrides IMoCState.getBucketNReserve
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
⤾ overrides IMoCState.getReserveTokenPrice
Arguments
Arguments
return the value of the liq threshold configuration param
Returns
liq threshold, currently 1.04
Arguments
sets the value of the liq threshold configuration param
Arguments
_liq
uint256
liquidation threshold
return the value of the utpdu threshold configuration param
Returns
utpdu Universal TPro discount sales coverage threshold
Arguments
sets the value of the utpdu threshold configuration param
Arguments
_utpdu
uint256
Universal TPro discount sales coverage threshold
returns the relation between StableToken and dollar. By default it is 1.
Returns
peg relation between StableToken and dollar
Arguments
sets the relation between StableToken and dollar. By default it is 1.
Arguments
_peg
uint256
relation between StableToken and dollar
⤾ overrides IMoCState.getProtected
return the value of the protected threshold configuration param
Returns
protected threshold, currently 1.5
Arguments
sets the value of the protected threshold configuration param
Arguments
_protected
uint256
protected threshold
returns if is liquidation enabled.
Returns
liquidationEnabled is liquidation enabled
Arguments
returns if is liquidation enabled.
Arguments
_liquidationEnabled
bool
is liquidation enabled
⤾ overrides IMoCState.nextState
Transitions to next state.
Arguments
Sets max mint RiskPro value
Arguments
_maxMintRiskPro
uint256
[using mocPrecision]
return Max value posible to mint of RiskPro
Returns
maxMintRiskPro
Arguments
Sets a new MoCProvider contract
Arguments
mocProviderAddress
address
MoC price provider address
Gets the MoCPriceProviderAddress
Returns
MoC price provider address
Arguments
⤾ overrides IMoCState.getMoCPrice
Gets the MoCPrice
Returns
MoC price
Arguments
Sets the MoC token contract address
Arguments
mocTokenAddress
address
MoC token contract address
⤾ overrides IMoCState.getMoCToken
Gets the MoC token contract address
Returns
MoC token contract address
Arguments
Sets the MoCVendors contract address
Arguments
mocVendorsAddress
address
MoCVendors contract address
⤾ overrides IMoCState.getMoCVendors
Gets the MoCVendors contract addfress
Returns
MoCVendors contract address
Arguments
⤾ overrides IMoCState.stableTokensToResToken
Arguments
stableTokenAmount
uint256
⤾ overrides IMoCState.resTokenToStableToken
Arguments
resTokensAmount
uint256
⤾ overrides IMoCState.riskProxToResToken
Arguments
riskProxAmount
uint256
bucket
bytes32
Arguments
riskProxAmount
uint256
bucket
bytes32
⤾ overrides IMoCState.resTokenToRiskProx
Arguments
resTokensAmount
uint256
bucket
bytes32
Sets the MoC token contract address (internal function)
Arguments
mocTokenAddress
address
MoC token contract address
Sets the MoCVendors contract address (internal function)
Arguments
mocVendorsAddress
address
MoCVendors contract address
Calculates price at liquidation event as the relation between the stableToken total supply and the amount of ReserveTokens available to distribute
Arguments
Arguments
_governor
address
_priceProvider
address
_liq
uint256
_utpdu
uint256
_maxDiscRate
uint256
_dayBlockSpan
uint256
_maxMintRiskPro
uint256
_mocPriceProvider
address
_liquidationEnabled
bool
_protected
uint256
Arguments
_mocTokenAddress
address
_mocVendorsAddress
address
⤿ Overridden Implementation(s):
âš 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.
⤿ Overridden Implementation(s):
âš 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.