Skip to main content

IPRICEv1

Git Source

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);

lastObservationTime

Unix timestamp of last observation (in seconds).

function lastObservationTime() external view returns (uint48);

decimals

Number of decimals in the price values provided by the contract.

function decimals() external view returns (uint8);

minimumTargetPrice

Minimum target price for RBS system. Set manually to correspond to the liquid backing of OHM.

function minimumTargetPrice() external view returns (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;

changeMovingAverageDuration

Change the moving average window (duration)

function changeMovingAverageDuration(uint48 movingAverageDuration_) external;

changeObservationFrequency

Change the observation frequency of the moving average (i.e. how often a new observation is taken)

function changeObservationFrequency(uint48 observationFrequency_) external;

changeUpdateThresholds

Change the update thresholds for the price feeds

function changeUpdateThresholds(uint48 ohmEthUpdateThreshold_, uint48 reserveEthUpdateThreshold_) external;

changeMinimumTargetPrice

Change the minimum target price

function changeMinimumTargetPrice(uint256 minimumTargetPrice_) external;

getCurrentPrice

Get the current price of OHM in the Reserve asset from the price feeds

function getCurrentPrice() external view returns (uint256);

getLastPrice

Get the last stored price observation of OHM in the Reserve asset

function getLastPrice() external view returns (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);

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);

Events

MinimumTargetPriceChanged

event MinimumTargetPriceChanged(uint256 minimumTargetPrice_);