EthPerTokenRateProvider
Inherits: IRateProvider
Reports the price of a token in terms of ETH. The underlying price feed must be compatible with the Chainlink interface.
State Variables
PRICE_FEED_TYPE
The type of price feed providers.
DESCRIPTION
The asset pair the rate provider queries.
PRICE_FEED
The underlying price feed that this rate provider reads from.
MAX_TIME_FROM_LAST_UPDATE
Number of seconds since last update to determine whether the price feed is stale.
RATE_DECIMALS
The preicision of the rate returned by this contract.
DECIMALS_OFFSET
The offset between the intended return decimals and the price feed decimals.
Based on the PriceFeedType
, the price feed's asset pair label is retrieved differently.
Functions
constructor
Parameters
Name | Type | Description |
---|---|---|
|
| The asset pair. ex) stETH/ETH |
|
| |
|
| |
|
| |
|
|
getRate
Gets the price of token in terms of ETH.
Returns
Name | Type | Description |
---|---|---|
|
| price of token in ETH. |
_validityCheck
To revert upon custom checks such as sequencer liveness.