ChainLinkLatestRoundData
Documentation for eth_defi.chainlink.round_data.ChainLinkLatestRoundData Python class.
- class ChainLinkLatestRoundData[source]
Human-readable presentation for Chainlink price booking.
Wraps IChainlinkAggregator.latestRoundData() response.
Example:
aggregator = chainlink_aggregator # Point to any Chainlink aggregator contract round_data = fetch_chainlink_round_data(web3, aggregator.address) ago = datetime.datetime.utcnow() - round_data.update_time print(f" {feed.primitive_token.symbol}, current price is {round_data.price:,.4f} USDC, Chainlink feed is {round_data.description}, updated {ago} ago")
Attributes summary
How many decimals the aggregator has been configured for.
Chainlink provided description of this feed
Human-readable price in this response.
Python datetime when the feed price was updated.
See ChainlinkAggregatorV2V3Interface.sol
Current round id
Price, non-decimal converted
When processing started
When price was updated last time
Which round gave the answer
Methods summary
__init__
(aggregator, round_id, answer, ...)- aggregator: web3.contract.contract.Contract
See ChainlinkAggregatorV2V3Interface.sol
- property update_time: datetime.datetime
Python datetime when the feed price was updated.
Naive timestamp
Always UTC
- property price: decimal.Decimal
Human-readable price in this response.