Skip to main content

CollateralizationOracleGuardian

Functions

constructor

function constructor(
address _core,
contract ICollateralizationOracleWrapper _oracleWrapper,
uint256 _frequency,
uint256 _deviationThresholdBasisPoints
) public

The constructor for CollateralizationOracleGuardian @param _core the core address to reference @param _oracleWrapper the instance of CollateralizationOracleWrapper @param _frequency the maximum frequency a guardian can update the cache @param _deviationThresholdBasisPoints the maximum percent change in a cache value for a given update

Parameters

NameTypeDescription
_coreaddress
_oracleWrappercontract ICollateralizationOracleWrapper
_frequencyuint256
_deviationThresholdBasisPointsuint256

setCache

function setCache(
uint256 protocolControlledValue,
uint256 userCirculatingFei
) external

guardian set the cache values on collateralization oracle

make sure to pause the CR oracle wrapper or else the set value would be overwritten on next update

Parameters

NameTypeDescription
protocolControlledValueuint256new PCV value
userCirculatingFeiuint256new user FEI value

calculateDeviationThresholdBasisPoints

function calculateDeviationThresholdBasisPoints(
uint256 a,
uint256 b
) public returns (uint256)

return the percent deviation between a and b in basis points terms

Parameters

NameTypeDescription
auint256
buint256

setDeviationThresholdBasisPoints

function setDeviationThresholdBasisPoints(
uint256 newDeviationThresholdBasisPoints
) external

governance setter for maximum deviation the guardian can change per update

Parameters

NameTypeDescription
newDeviationThresholdBasisPointsuint256

_setDeviationThresholdBasisPoints

function _setDeviationThresholdBasisPoints(
uint256 newDeviationThresholdBasisPoints
) internal

Parameters

NameTypeDescription
newDeviationThresholdBasisPointsuint256

Events

DeviationThresholdUpdate

event DeviationThresholdUpdate(
uint256 oldDeviationThresholdBasisPoints,
uint256 newDeviationThresholdBasisPoints
)

Parameters

NameTypeDescription
oldDeviationThresholdBasisPointsuint256
newDeviationThresholdBasisPointsuint256