degenbot.chainlink.price_feed¶
Chainlink price feed oracle contract interface.
Module Contents¶
- class degenbot.chainlink.price_feed.ChainlinkPriceContract(address: str, *, chain_id: degenbot.types.aliases.ChainId | None = None, decimals: int | None = None, bot: degenbot.bot.Bot | None = None)¶
Represents an on-chain Chainlink price oracle.
Constructed with the oracle address and chain_id. The
priceproperty fetches the current price and decimals on access.The
priceproperty returns the decimal-corrected nominal token price in USD (e.g. 1 DAI = 1.0 USD).This is a delegating shell over the Rust
ChainlinkPriceFeedreader (thedegenbot-pricecore crate, ADR-005). The inlineprovider.call_raw/abi_decodebodies are retired —eth_call+ canonical ABI decode now run in Rust. The floatpriceis computed here (display layer) from the rawint256answer +decimals, preserving the priorfloat(answer / 10**decimals)behavior exactly.- address¶
- property chain_id: degenbot.types.aliases.ChainId | None¶
Chain id.
- property decimals: int¶
Decimals.
- Raises:
ValueError – See function documentation.
- property price: float¶
Price.
- Raises:
ValueError – See function documentation.