degenbot.chainlink.price_feed ============================= .. py:module:: degenbot.chainlink.price_feed .. autoapi-nested-parse:: Chainlink price feed oracle contract interface. Module Contents --------------- .. py:class:: 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. .. py:attribute:: address .. py:property:: chain_id :type: degenbot.types.aliases.ChainId | None Chain id. .. py:property:: decimals :type: int Decimals. :raises ValueError: See function documentation. .. py:property:: price :type: float Price. :raises ValueError: See function documentation.