JBChainlinkV3PriceFeed
Inherits: IJBPriceFeed
An IJBPriceFeed implementation that reports prices from a Chainlink AggregatorV3Interface.
State Variables
FEED
The Chainlink feed that prices are reported from.
AggregatorV3Interface public immutable FEED;
THRESHOLD
How many seconds old a Chainlink price update is allowed to be before considered "stale".
uint256 public immutable THRESHOLD;
Functions
constructor
constructor(AggregatorV3Interface feed, uint256 threshold);
Parameters
| Name | Type | Description | 
|---|---|---|
feed | AggregatorV3Interface | The Chainlink feed to report prices from. | 
threshold | uint256 | How many seconds old a price update may be. | 
currentUnitPrice
Gets the current price (per 1 unit) from the feed.
function currentUnitPrice(uint256 decimals) public view virtual override returns (uint256);
Parameters
| Name | Type | Description | 
|---|---|---|
decimals | uint256 | The number of decimals the return value should use. | 
Returns
| Name | Type | Description | 
|---|---|---|
<none> | uint256 | The current unit price from the feed, as a fixed point number with the specified number of decimals. | 
Errors
JBChainlinkV3PriceFeed_IncompleteRound
error JBChainlinkV3PriceFeed_IncompleteRound();
JBChainlinkV3PriceFeed_NegativePrice
error JBChainlinkV3PriceFeed_NegativePrice(int256 price);
JBChainlinkV3PriceFeed_StalePrice
error JBChainlinkV3PriceFeed_StalePrice(uint256 timestamp, uint256 threshold, uint256 updatedAt);