ChainLinkLatestRoundData
Documentation for eth_defi.chainlink.round_data.ChainLinkLatestRoundData Python class.
- class ChainLinkLatestRoundData
Bases:
objectHuman-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 = native_datetime_utc_now() - 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.
Methods summary
__init__(aggregator, round_id, answer, ...)- __init__(aggregator, round_id, answer, started_at, updated_at, answered_in_round)
- property decimals: int
How many decimals the aggregator has been configured for.
- property description: str
Chainlink provided description of this feed
- property price: decimal.Decimal
Human-readable price in this response.
- property update_time: datetime.datetime
Python datetime when the feed price was updated.
Naive timestamp
Always UTC