wstETHPriceProvider
Overview
License: MIT
Price provider that uses chainlink
This contract is used to get the price of wstETH in USD.
Events info
SetTokenAndAggregator
Emitted when the wstETH address and aggregator path are set.
Parameters:
SetTimeOut
Emitted when the time out for a Chainlink aggregator path is set.
Parameters:
Constants info
MODERATOR_ROLE (0x797669c9)
DESCRIPTION (0xf1ae8856)
MAX_PRICE_PATH_LENGTH (0x01a9a5d3)
State variables info
tokenDecimals (0x3b97e856)
wstETH (0x4aa07e64)
aggregatorPath (0x004645ff)
timeOuts (0x2a6377a9)
Modifiers info
onlyModerator
Modifier to restrict access to functions to only the moderator role. The caller must have the moderator role to execute the function.
Functions info
initialize (0x946d9204)
Initializes the wstETH price provider contract with the given wstETH address and aggregator path.
Parameters:
addAggregatorPath (0xbe04eba7)
Adds a new aggregator path for the price oracle.
Requirements:
Only the moderator can call this function.
The length of the aggregator path must not exceed MAX_PRICE_PATH_LENGTH.
Parameters:
setTimeOut (0x60c74154)
Sets the timeout value corresponding to the aggregatorPath.
Example: ETH/USD have a new answer is written when the off-chain data moves more than the 0.5% deviation threshold or 3600 seconds have passed since the last answer was written on-chain. So, the timeOut value for each aggregator will be equal to the heartbeat threshold value plus a period of time to make the transaction update the price, that time period can be 60s or a little more.
Parameters:
isActive (0x9f8a13d7)
Checks if the given token is active.
Parameters:
Return values:
getPriceSTETH (0xcd78d6d4)
Returns the price of stETH in USD.
Return values:
getPrice (0x41976e09)
Returns the price of the given token in USD.
Parameters:
Return values:
getPriceDecimals (0x1b30aafc)
Returns the number of decimals used for the USD price.
Return values:
getLatestPrice (0x16345f18)
Returns the latest price after performing sanity check and staleness check.
Parameters:
Return values:
Last updated