ChainlinkPriceFeedMedianizer
has a similar interface to the Governance Led Median although, instead of relying on governance whitelisted oracles, it simply keeps a reference to a Chainlink price reference contract (price aggregator).authorizedAccounts [usr: address]
- addAuthorization
/removeAuthorization
/isAuthorized
- auth mechanismsstaleThreshold
- time since linkAggregatorTimestamp
after which the median value is considered stale chainlinkAggregator
- address of the Chainlink price reference contractrewardRelayer
- address of the contract that rewards addresses that call updateResult
medianPrice
- latest fetched price lastUpdateTime
- latest timestamp when the contract pulled a price update from Chainlinkmultiplier
- scaling factor for the Chainlink result (e.g if the price has 8 decimals and we want it to be scaled to 18 decimals, multiplier = 10
and medianPrice = fetchedPrice * 10 ^ multiplier
)symbol
- the price oracle type (ex: ETHUSD)periodSize
- the minimum delay between two consecutive updates after which the reward for updating again starts to increaselinkAggregatorTimestamp
- the timestamp of the Chainlink aggregator's latest price updateisAuthorized
- checks whether an address is part of authorizedAddresses
(and thus can call authed functions).modifyParameters
- allows governance to change contract parametersread() public view returns (uint256)
- gets a non-zero price or failsgetResultWithValidity() public view returns (uint256,bool)
- gets the price and its validityupdateResult(feeReceiver: address)
- updates the price stored in the contract by calling the Chainlink aggregatorAddAuthorization
- emitted when a new address becomes authorized. Contains:account
- the new authorized accountRemoveAuthorization
- emitted when an address is de-authorized. Contains:account
- the address that was de-authorizedModifyParameters
- emitted when a parameter is updatedUpdateResult
- emitted when updateResult
is called. Contains:medianPrice
- the latest median pricelastUpdateTime
- timestamp of the callupdateResult
and update the median price regularly using a rewardRelayer
.