TermPriceConsumerV3.sol
This contract operates at the protocol level and governs all instances of a Term Repo. This contract is a centralized price oracle contract that feeds pricing data to all Term Repos.
TermPriceConsumerV3
This contract is a centralized price oracle contract that feeds pricing data to all Term Repos
This contract operates at the protocol level and governs all instances of a Term Repo
DEVOPS_ROLE
bytes32 DEVOPS_ROLEDEFAULT_MAX_DATA_TIMESTAMP_AHEAD_SECONDS
uint256 DEFAULT_MAX_DATA_TIMESTAMP_AHEAD_SECONDSpriceFeeds
mapping(address => struct TermPriceFeedConfig) priceFeedsfallbackPriceFeeds
mapping(address => struct TermPriceFeedConfig) fallbackPriceFeedsconstructor
constructor() publicinitialize
Intializes with an array of token addresses, followed with an array of Chainlink aggregator addresses https://docs.chain.link/docs/ethereum-addresses/
usdValueOfTokens
A function to return current market value given a token address and an amount
Parameters
token
address
The address of the token to query
amount
uint256
The amount tokens to value
Return Values
[0]
struct ExponentialNoError.Exp
The current market value of tokens at the specified amount, in USD
addNewTokenPriceFeedAndFallbackPriceFeed
Parameters
token
address
The address of the token to add a price feed for
tokenPriceAggregator
address
The price aggregator address for token to be added
tokenPriceAggregatorRefreshRateThreshold
uint256
Refresh threshold in seconds for primary price feed updates beyond which price is stale
fallbackPriceAggregator
address
The fallback price aggregator address for token to be added
fallbackPriceAggregatorRefreshRateThreshold
uint256
Refresh threshold for fallback price feed updates beyond which price is stale
addNewTokenPriceFeed
Parameters
token
address
The address of the token to add a price feed for
tokenPriceAggregator
address
The proxy price aggregator address for token to be added
refreshRateThreshold
uint256
Refresh threshold in seconds for primary price feed updates beyond which price is stale
addNewTokenFallbackPriceFeed
Parameters
token
address
The address of the token to add a price feed for
tokenPriceAggregator
address
The proxy price aggregator address for token to be added
refreshRateThreshold
uint256
Refresh threshold in seconds for fallback price feed updates beyond which price is stale
removeTokenPriceFeed
Parameters
token
address
The address of the token whose price feed needs to be removed
removeFallbackTokenPriceFeed
Parameters
token
address
The address of the token whose price feed needs to be removed
getPriceFeedConfig
Get the primary price feed configuration for a token
Parameters
token
address
The address of the token to query
Return Values
priceFeed
address
The address of the primary price feed aggregator
refreshRateThreshold
uint256
The refresh rate threshold in seconds
getFallbackPriceFeedConfig
Get the fallback price feed configuration for a token
Parameters
token
address
The address of the token to query
Return Values
fallbackPriceFeed
address
The address of the fallback price feed aggregator
refreshRateThreshold
uint256
The refresh rate threshold in seconds
_addNewTokenPriceFeed
Parameters
token
address
The address of the token to add a price feed for
tokenPriceAggregator
address
The proxy price aggregator address for token to be added
refreshRateThreshold
uint256
Refresh threshold in seconds for primary price feed updates beyond which price is stale
_addNewTokenFallbackPriceFeed
Parameters
token
address
The address of the token to add a price feed for
tokenPriceAggregator
address
The proxy price aggregator address for token to be added
refreshRateThreshold
uint256
Refresh threshold in seconds for fallback price feed updates beyond which price is stale
_getLatestPrice
Return Values
latestPrice
int256
The latest price from price aggregator
decimals
uint8
The decimals in the price
_authorizeUpgrade
required override by the OpenZeppelin UUPS module
Last updated