degenbot.builders.protocol ========================== .. py:module:: degenbot.builders.protocol .. autoapi-nested-parse:: Protocol for pool construction and state updates. Each builder owns: - The I/O choreography (Rust-backed metadata lookup → RPC fetch → decode → construct) - Pool registration in the Pool Registry - State updates via pool.external_update() Builders do NOT own: - Pool type resolution (Bot's job) - I/O routing (received via BotIo — the single Rust-backed executor) - Database I/O (owned by the Rust ConstructionIo handle attached to Bot) Module Contents --------------- .. py:class:: PoolBuilder Bases: :py:obj:`Protocol` Protocol for pool construction and state updates. Builders must accept ``address`` as the first positional-or-keyword parameter in ``build()``, and ``pool`` as the first positional-or-keyword parameter in ``update()``. Optional parameters are forwarded via ``request: BuildPoolRequest`` — builders read the fields they recognize and ignore the rest. The ``io`` argument is a :class:`~degenbot._ffi.BotIo` — the single construction-I/O executor (Rust-backed, 65 methods). There is no sync/async fork; ``AsyncBot`` and the async builders are retired. .. py:method:: build(address: str, *, chain_id: int | None = None, io: degenbot._ffi.BotIo, request: degenbot.builders.request.BuildRequest) -> degenbot.types.abstract.liquidity_pool.AbstractLiquidityPool Build a pool from on-chain data. .. py:method:: update(pool: degenbot.types.abstract.liquidity_pool.AbstractLiquidityPool, *, io: degenbot._ffi.BotIo | None = None, block_number: int | None = None) -> bool :staticmethod: Update the pool state from on-chain data.