Skip to main content

OlympusPriceConfig

Methods

ROLES

function ROLES() external view returns (contract ROLESv1)

Returns

NameTypeDescription
_0contract ROLESv1undefined

changeKernel

function changeKernel(contract Kernel newKernel_) external nonpayable

Function used by kernel when migrating to a new kernel.

Parameters

NameTypeDescription
newKernel_contract Kernelundefined

changeMovingAverageDuration

function changeMovingAverageDuration(uint48 movingAverageDuration_) external nonpayable

Change the moving average window (duration)

Setting the window to a larger number of observations than the current window will clear the data in the current window and require the initialize function to be called again. Ensure that you have saved the existing data and can re-populate before calling this function with a number of observations larger than have been recorded.

Parameters

NameTypeDescription
movingAverageDuration_uint48Moving average duration in seconds, must be a multiple of observation frequency

changeObservationFrequency

function changeObservationFrequency(uint48 observationFrequency_) external nonpayable

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

Changing the observation frequency clears existing observation data since it will not be taken at the right time intervals. Ensure that you have saved the existing data and/or can re-populate before calling this function.

Parameters

NameTypeDescription
observationFrequency_uint48Observation frequency in seconds, must be a divisor of the moving average duration

changeUpdateThresholds

function changeUpdateThresholds(uint48 ohmEthUpdateThreshold_, uint48 reserveEthUpdateThreshold_) external nonpayable

Change the update thresholds for the price feeds

The update thresholds should be set based on the update threshold of the chainlink oracles.

Parameters

NameTypeDescription
ohmEthUpdateThreshold_uint48- Maximum allowed time between OHM/ETH price feed updates
reserveEthUpdateThreshold_uint48- Maximum allowed time between Reserve/ETH price feed updates

configureDependencies

function configureDependencies() external nonpayable returns (Keycode[] dependencies)

Define module dependencies for this policy.

Returns

NameTypeDescription
dependenciesKeycode[]- Keycode array of module dependencies.

initialize

function initialize(uint256[] startObservations_, uint48 lastObservationTime_) external nonpayable

Initialize the price moduleAccess restricted to approved policies

This function must be called after the Price module is deployed to activate it and after updating the observationFrequency or movingAverageDuration (in certain cases) in order for the Price module to function properly.

Parameters

NameTypeDescription
startObservations_uint256[]Array of observations to initialize the moving average with. Must be of length numObservations.
lastObservationTime_uint48Unix timestamp of last observation being provided (in seconds).

isActive

function isActive() external view returns (bool)

Easily accessible indicator for if a policy is activated or not.

Returns

NameTypeDescription
_0boolundefined

kernel

function kernel() external view returns (contract Kernel)

Returns

NameTypeDescription
_0contract Kernelundefined

requestPermissions

function requestPermissions() external view returns (struct Permissions[] permissions)

Function called by kernel to set module function permissions.

Returns

NameTypeDescription
permissionsPermissions[]- Array of keycodes and function selectors for requested permissions.

Errors

KernelAdapter_OnlyKernel

error KernelAdapter_OnlyKernel(address caller_)

Parameters

NameTypeDescription
caller_addressundefined

Policy_ModuleDoesNotExist

error Policy_ModuleDoesNotExist(Keycode keycode_)

Parameters

NameTypeDescription
keycode_Keycodeundefined