Skip to main content

ChainlinkAggregator.sol

ChainlinkAggregator

ChainlinkAggregatorLib

Library that manages interfacing with the Chainlink Feed Aggregator Proxy.

decimals

function decimals(ChainlinkAggregator self) internal view returns (uint8)

Returns the decimal amount for a specific feed

  • Parameters:

    NameTypeDescription
    selfChainlinkAggregatorChainlink Feed Aggregator to operate on
  • Return Values:

    NameTypeDescription
    [0]uint8Decimal amount

getLatestRound

function getLatestRound(ChainlinkAggregator self) internal view returns (struct ChainlinkRound)

Returns the latest round data for a specific feed

  • Parameters:

    NameTypeDescription
    selfChainlinkAggregatorChainlink Feed Aggregator to operate on
  • Return Values:

    NameTypeDescription
    [0]struct ChainlinkRoundLatest round data

getRound

function getRound(ChainlinkAggregator self, uint256 roundId) internal view returns (struct ChainlinkRound)

Returns a specific round's data for a specific feed

  • Parameters:

    NameTypeDescription
    selfChainlinkAggregatorChainlink Feed Aggregator to operate on
    roundIduint256The specific round to fetch data for
  • Return Values:

    NameTypeDescription
    [0]struct ChainlinkRoundSpecific round's data

getPhaseSwitchoverData

function getPhaseSwitchoverData(ChainlinkAggregator self, uint256 startingRoundId, uint256 lastSyncedRoundId, struct ChainlinkRound latestRound) internal view returns (uint256 roundCount, uint256 nextPhaseStartingRoundId)

Returns the round count and next phase starting round for the lastSyncedRound phase

  • Parameters:

    NameTypeDescription
    selfChainlinkAggregatorChainlink Feed Aggregator to operate on
    startingRoundIduint256starting roundId for the aggregator proxy
    lastSyncedRoundIduint256last synced round ID for the proxy
    latestRoundstruct ChainlinkRoundlatest round from the proxy
  • Return Values:

    NameTypeDescription
    roundCountuint256The number of rounds in the phase
    nextPhaseStartingRoundIduint256The starting round ID for the next phase