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

Returns

NameTypeDescription
<none>uint48

lastObservationTime​

Unix timestamp of last observation (in seconds).

function lastObservationTime() external view returns (uint48);

Returns

NameTypeDescription
<none>uint48

decimals​

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

function decimals() external view returns (uint8);

Returns

NameTypeDescription
<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

NameTypeDescription
<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

NameTypeDescription
startObservations_uint256[]
lastObservationTime_uint48

changeMovingAverageDuration​

Change the moving average window (duration)

function changeMovingAverageDuration(uint48 movingAverageDuration_) external;

Parameters

NameTypeDescription
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

NameTypeDescription
observationFrequency_uint48

changeUpdateThresholds​

Change the update thresholds for the price feeds

function changeUpdateThresholds(
uint48 ohmEthUpdateThreshold_,
uint48 reserveEthUpdateThreshold_
) external;

Parameters

NameTypeDescription
ohmEthUpdateThreshold_uint48
reserveEthUpdateThreshold_uint48

changeMinimumTargetPrice​

Change the minimum target price

function changeMinimumTargetPrice(uint256 minimumTargetPrice_) external;

Parameters

NameTypeDescription
minimumTargetPrice_uint256

getCurrentPrice​

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

function getCurrentPrice() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

getLastPrice​

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

function getLastPrice() external view returns (uint256);

Returns

NameTypeDescription
<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

NameTypeDescription
<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

NameTypeDescription
<none>uint256

Events​

MinimumTargetPriceChanged​

event MinimumTargetPriceChanged(uint256 minimumTargetPrice_);

Parameters

NameTypeDescription
minimumTargetPrice_uint256