degenbot.builders.balancer_builder ================================== .. py:module:: degenbot.builders.balancer_builder .. autoapi-nested-parse:: Balancer V2 pool builder. Owns the full I/O choreography: RPC fetch → decode → construct → register. Pool type is determined via _detect_pool_type() which probes the contract for characteristics (has getNormalizedWeights → WEIGHTED, has getAmplificationParameter → STABLE). Raises a clear error for unknown types instead of defaulting to stable. Module Contents --------------- .. py:class:: BalancerBuilder(ctx: degenbot.builders.context.BuilderContext) Bases: :py:obj:`degenbot.builders.balancer_builder_base.BalancerBuilderBase` Builds and updates Balancer V2 pools (weighted, stable, composable). Owns the full I/O choreography: RPC fetch → decode → construct → register. .. py:method:: build(address: str, *, chain_id: degenbot.types.aliases.ChainId | None = None, io: degenbot._ffi.BotIo, request: degenbot.builders.request.BuildRequest) -> degenbot.types.abstract.liquidity_pool.AbstractLiquidityPool Fetch pool data from RPC and construct an I/O-free Balancer pool. :returns: The computed value. :raises DegenbotValueError: If the operation fails. :raises BrokenPool: If the operation fails. .. py:method:: update(pool: degenbot.types.abstract.liquidity_pool.AbstractLiquidityPool, *, io: degenbot._ffi.BotIo | None = None, block_number: int | None = None) -> bool :staticmethod: Fetch new balances from Vault and update the pool. :returns: The computed value. :raises TypeError: If the operation fails.