Price Aggregator
Contains the Library and the Facet required to pull information on token prices in Chainlink.
ChainLinkAggFacet
ChainLinkAggLib
contains functions that help:isTokenSupported
checks if a token is supported and has a pair aggregatoraggregatorFor
grabs the ChainLink Aggregator address to check if a token pair is supported
PriceAggFacet
PriceAggFacet
Contains helper functions that:
getValueFor
calculates the value of a source token amount into a destination tokenpriceFor
calculates a price from Compound. If price isn't found from compound, then it tries to retrieve it from ChainLinkisCToken
checks if a token is a cToken and returns the address of the token if truecompoundPriceFor
retrieves the price of a source token in destination token from CompoundchainlinkPriceFor
retrieves the price of a source token in destination token from ChainLink
PriceAggLib
PriceAggLib
Implements both the valueFor
and priceFor
functions to retrieve both values and prices of a source token to a destination token.
Last updated