IPRICEv1
Price oracle interface for PRICEv1
Minimal interface extracted from PRICEv1 abstract contract
Functions
observationFrequency
Frequency (in seconds) that observations should be stored.
function observationFrequency() external view returns (uint48);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint48 |
lastObservationTime
Unix timestamp of last observation (in seconds).
function lastObservationTime() external view returns (uint48);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint48 |
decimals
Number of decimals in the price values provided by the contract.
function decimals() external view returns (uint8);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint8 |
minimumTargetPrice
Minimum target price for RBS system. Set manually to correspond to the liquid backing of OHM.
function minimumTargetPrice() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
updateMovingAverage
Trigger an update of the moving average. Permissioned.
function updateMovingAverage() external;
initialize
Initialize the price module
function initialize(uint256[] memory startObservations_, uint48 lastObservationTime_) external;
Parameters
| Name | Type | Description |
|---|---|---|
| startObservations_ | uint256[] | |
| lastObservationTime_ | uint48 |
changeMovingAverageDuration
Change the moving average window (duration)
function changeMovingAverageDuration(uint48 movingAverageDuration_) external;
Parameters
| Name | Type | Description |
|---|---|---|
| movingAverageDuration_ | uint48 |
changeObservationFrequency
Change the observation frequency of the moving average (i.e. how often a new observation is taken)
function changeObservationFrequency(uint48 observationFrequency_) external;
Parameters
| Name | Type | Description |
|---|---|---|
| observationFrequency_ | uint48 |
changeUpdateThresholds
Change the update thresholds for the price feeds
function changeUpdateThresholds(
uint48 ohmEthUpdateThreshold_,
uint48 reserveEthUpdateThreshold_
) external;
Parameters
| Name | Type | Description |
|---|---|---|
| ohmEthUpdateThreshold_ | uint48 | |
| reserveEthUpdateThreshold_ | uint48 |
changeMinimumTargetPrice
Change the minimum target price
function changeMinimumTargetPrice(uint256 minimumTargetPrice_) external;
Parameters
| Name | Type | Description |
|---|---|---|
| minimumTargetPrice_ | uint256 |
getCurrentPrice
Get the current price of OHM in the Reserve asset from the price feeds
function getCurrentPrice() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getLastPrice
Get the last stored price observation of OHM in the Reserve asset
function getLastPrice() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getMovingAverage
Get the stored moving average of OHM in the Reserve asset over the defined window (see movingAverageDuration and observationFrequency).
This accessor may return a stale value.
function getMovingAverage() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getTargetPrice
Get target price of OHM in the Reserve asset for the RBS system
Reverts when the OHM moving average is stale.
function getTargetPrice() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
Events
MinimumTargetPriceChanged
event MinimumTargetPriceChanged(uint256 minimumTargetPrice_);
Parameters
| Name | Type | Description |
|---|---|---|
| minimumTargetPrice_ | uint256 |