Skip to main content

JBChainlinkV3SequencerPriceFeed

Git Source

Inherits: JBChainlinkV3PriceFeed

An IJBPriceFeed implementation that reports prices from a Chainlink AggregatorV3Interface from optimistic sequencers.

State Variables

GRACE_PERIOD_TIME

How long the sequencer must be re-active in order to return a price.

uint256 public immutable GRACE_PERIOD_TIME;

SEQUENCER_FEED

The Chainlink sequencer feed that prices are reported from.

AggregatorV2V3Interface public immutable SEQUENCER_FEED;

Functions

constructor

constructor(
AggregatorV3Interface feed,
uint256 gracePeriod,
AggregatorV2V3Interface sequencerFeed,
uint256 threshold
)
JBChainlinkV3PriceFeed(feed, threshold);

Parameters

NameTypeDescription
feedAggregatorV3InterfaceThe Chainlink feed to report prices from.
gracePerioduint256How long the sequencer should have been re-active before returning prices.
sequencerFeedAggregatorV2V3InterfaceThe Chainlink feed to report sequencer status.
thresholduint256How many blocks old a price update may be.

currentUnitPrice

Gets the current price (per 1 unit) from the feed.

function currentUnitPrice(uint256 decimals) public view override returns (uint256);

Parameters

NameTypeDescription
decimalsuint256The number of decimals the return value should use.

Returns

NameTypeDescription
<none>uint256The current unit price from the feed, as a fixed point number with the specified number of decimals.

Errors

JBChainlinkV3SequencerPriceFeed_SequencerDownOrRestarting

error JBChainlinkV3SequencerPriceFeed_SequencerDownOrRestarting(
uint256 timestamp, uint256 gradePeriodTime, uint256 startedAt
);