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 price property fetches the current price and decimals on access.

The price property returns the decimal-corrected nominal token price in USD (e.g. 1 DAI = 1.0 USD).

This is a delegating shell over the Rust ChainlinkPriceFeed reader (the degenbot-price core crate, ADR-005). The inline provider.call_raw / abi_decode bodies are retired — eth_call + canonical ABI decode now run in Rust. The float price is computed here (display layer) from the raw int256 answer + decimals, preserving the prior float(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.