ChainlinkOracle

Git Sourcearrow-up-right

Inherits: OracleWrapper

Contains the logic for retrieving data from a Chainlink oracle and converting it to the QuantAMM format using the oracle wrapper contract

State Variables

priceFeed

AggregatorV3Interface internal immutable priceFeed;

normalizationFactor

Difference of feed result to 18 decimals. We store the difference instead of the oracle decimals for optimization reasons (saves a subtraction in _getData)

uint256 internal immutable normalizationFactor;

Functions

constructor

constructor(address _chainlinkFeed);

Parameters

Name
Type
Description

_chainlinkFeed

address

the address of the Chainlink oracle to wrap

_getData

Returns the latest data from the oracle in the QuantAMM format

Returns

Name
Type
Description

<none>

int216

data the latest data from the oracle in the QuantAMM format

<none>

uint40

timestamp the timestamp of the data retrieval

Last updated