PriceAggregatorUtils

GNSPriceAggregator facet external library

initializePriceAggregator

function initializePriceAggregator(address _linkErc677, contract IChainlinkFeed _linkUsdPriceFeed, uint24 _twapInterval, uint8 _minAnswers, address[] _oracles, bytes32[2] _jobIds, uint8[] _collateralIndices, struct IPriceAggregator.LiquidityPoolInput[] _gnsCollateralLiquidityPools, contract IChainlinkFeed[] _collateralUsdPriceFeeds) external

Check IPriceAggregatorUtils interface for documentation

updateLinkUsdPriceFeed

function updateLinkUsdPriceFeed(contract IChainlinkFeed _value) public

Check IPriceAggregatorUtils interface for documentation

updateCollateralUsdPriceFeed

function updateCollateralUsdPriceFeed(uint8 _collateralIndex, contract IChainlinkFeed _value) public

Check IPriceAggregatorUtils interface for documentation

updateCollateralGnsLiquidityPool

function updateCollateralGnsLiquidityPool(uint8 _collateralIndex, struct IPriceAggregator.LiquidityPoolInput _liquidityPoolInput) public

Check IPriceAggregatorUtils interface for documentation

updateTwapInterval

Check IPriceAggregatorUtils interface for documentation

updateMinAnswers

Check IPriceAggregatorUtils interface for documentation

addOracle

Check IPriceAggregatorUtils interface for documentation

replaceOracle

Check IPriceAggregatorUtils interface for documentation

removeOracle

Check IPriceAggregatorUtils interface for documentation

setMarketJobId

Check IPriceAggregatorUtils interface for documentation

setLimitJobId

Check IPriceAggregatorUtils interface for documentation

getPrice

Check IPriceAggregatorUtils interface for documentation

fulfill

Check IPriceAggregatorUtils interface for documentation

Check IPriceAggregatorUtils interface for documentation

getLinkFee

Check IPriceAggregatorUtils interface for documentation

getCollateralPriceUsd

Check IPriceAggregatorUtils interface for documentation

getUsdNormalizedValue

Check IPriceAggregatorUtils interface for documentation

getCollateralFromUsdNormalizedValue

Check IPriceAggregatorUtils interface for documentation

getGnsPriceUsd

Check IPriceAggregatorUtils interface for documentation

getGnsPriceUsd

Check IPriceAggregatorUtils interface for documentation

getGnsPriceCollateralAddress

Check IPriceAggregatorUtils interface for documentation

getGnsPriceCollateralIndex

Check IPriceAggregatorUtils interface for documentation

getLinkUsdPriceFeed

Check IPriceAggregatorUtils interface for documentation

getTwapInterval

Check IPriceAggregatorUtils interface for documentation

getMinAnswers

Check IPriceAggregatorUtils interface for documentation

getMarketJobId

Check IPriceAggregatorUtils interface for documentation

getLimitJobId

Check IPriceAggregatorUtils interface for documentation

getOracle

Check IPriceAggregatorUtils interface for documentation

getOracles

Check IPriceAggregatorUtils interface for documentation

getCollateralGnsLiquidityPool

Check IPriceAggregatorUtils interface for documentation

getCollateralUsdPriceFeed

Check IPriceAggregatorUtils interface for documentation

getPriceAggregatorOrder

Check IPriceAggregatorUtils interface for documentation

getPriceAggregatorOrderAnswers

Check IPriceAggregatorUtils interface for documentation

getChainlinkToken

Check IPriceAggregatorUtils interface for documentation

getRequestCount

Check IPriceAggregatorUtils interface for documentation

getPendingRequest

Check IPriceAggregatorUtils interface for documentation

_getSlot

Returns storage slot to use when fetching storage relevant to library

_getStorage

Returns storage pointer for storage struct in diamond contract, at defined slot

_getMultiCollatDiamond

Returns current address as multi-collateral diamond interface to call other facets functions.

validCollateralIndex

Reverts if collateral index is not valid

_median

returns median price of array (1 price only)

Parameters

Name
Type
Description

_array

array of values

_medianLookbacks

returns median prices of array (open, high, low)

Parameters

Name
Type
Description

_array

array of values

_swap

swaps two elements in array

Parameters

Name
Type
Description

_array

uint256[]

array of values

_i

uint256

index of first element

_j

uint256

index of second element

_sort

sorts array of uint256 values

Parameters

Name
Type
Description

_array

uint256[]

array of values

begin

uint256

start index

end

uint256

end index

_getCollateralPrecisionDelta

Returns precision delta of collateral as uint256

Parameters

Name
Type
Description

_collateralIndex

uint8

index of collateral

Last updated

Was this helpful?