IPIDRateSetter

Git Source

Inherits: IAuthorizable, IModifiable

Functions

oracleRelayer

The oracle relayer where the redemption price and rate are stored

function oracleRelayer() external view returns (IOracleRelayer _oracleRelayer);

pidCalculator

The PID calculator used to compute the redemption rate

function pidCalculator() external view returns (IPIDController _pidCalculator);

params

Getter for the contract parameters struct

function params() external view returns (PIDRateSetterParams memory _pidRateSetterParams);

Returns

NameTypeDescription
_pidRateSetterParamsPIDRateSetterParamsPIDRateSetter parameters struct

_params

Getter for the unpacked contract parameters struct

function _params() external view returns (uint256 _updateRateDelay);

Returns

NameTypeDescription
_updateRateDelayuint256Enforced gap between calls

lastUpdateTime

The timestamp of the last update

function lastUpdateTime() external view returns (uint256 _lastUpdateTime);

updateRate

Compute and set a new redemption rate

function updateRate() external;

Events

UpdateRedemptionRate

Emitted when the redemption rate is updated

event UpdateRedemptionRate(uint256 _marketPrice, uint256 _redemptionPrice, uint256 _redemptionRate);

Parameters

NameTypeDescription
_marketPriceuint256Computed price of the system coin
_redemptionPriceuint256Redemption price of the system coin
_redemptionRateuint256Resulting new redemption rate

Errors

PIDRateSetter_InvalidPriceFeed

Throws if the market price feed returns an invalid value

error PIDRateSetter_InvalidPriceFeed();

PIDRateSetter_RateSetterCooldown

Throws if the call to updateRate is too soon since last update

error PIDRateSetter_RateSetterCooldown();

Structs

PIDRateSetterParams

struct PIDRateSetterParams {
  uint256 updateRateDelay;
}