Skip to main content
Facet #10: Price aggregator (does the requests to the Chainlink DON, takes the median, and executes callbacks)

constructor

initializePriceAggregator

Initializes price aggregator facet

Parameters

updateLinkUsdPriceFeed

Updates LINK/USD chainlink price feed

Parameters

updateCollateralUsdPriceFeed

Updates collateral/USD chainlink price feed

Parameters

updateCollateralGnsLiquidityPool

Updates collateral/GNS liquidity pool

Parameters

updateTwapInterval

Updates TWAP interval

Parameters

updateMinAnswers

Updates minimum answers count

Parameters

addOracle

Adds an oracle

Parameters

replaceOracle

Replaces an oracle

Parameters

removeOracle

Removes an oracle

Parameters

setMarketJobId

Updates market job id

Parameters

setLimitJobId

Updates lookback job id

Parameters

getPrice

Requests price from oracles

Parameters

fulfill

Fulfills price request, called by chainlink oracles

Parameters

Claims back LINK tokens, called by gov fund

getLinkFee

Returns LINK fee for price request

Parameters

getCollateralPriceUsd

Returns collateral/USD price

Parameters

getUsdNormalizedValue

Returns USD normalized value from collateral value

Parameters

getCollateralFromUsdNormalizedValue

Returns collateral value (collateral precision) from USD normalized value

Parameters

getGnsPriceUsd

Returns GNS/USD price based on GNS/collateral price

Parameters

getGnsPriceUsd

Returns GNS/USD price based on GNS/collateral price

Parameters

getGnsPriceCollateralIndex

Returns GNS/collateral price

Parameters

getGnsPriceCollateralAddress

Returns GNS/collateral price

Parameters

getLinkUsdPriceFeed

Returns the link/usd price feed address

getTwapInterval

Returns the twap interval in seconds

getMinAnswers

Returns the minimum answers to execute an order and take the median

getMarketJobId

Returns the market job id

getLimitJobId

Returns the limit job id

getOracle

Returns a specific oracle

Parameters

getOracles

Returns all oracles

getCollateralGnsLiquidityPool

Returns collateral/gns liquidity pool info

Parameters

getCollateralUsdPriceFeed

Returns collateral/usd chainlink price feed

Parameters

getPriceAggregatorOrder

Returns order data

Parameters

getPriceAggregatorOrderAnswers

Returns order data

Parameters

getChainlinkToken

Returns chainlink token address

getRequestCount

Returns requestCount (used by ChainlinkClientUtils)

getPendingRequest

Returns pendingRequests mapping entry (used by ChainlinkClientUtils)