degenbot.builders.curve_pool_builder¶

Curve StableSwap pool builder (sync).

Module Contents¶

class degenbot.builders.curve_pool_builder.CurvePoolBuilder(ctx: degenbot.builders.context.BuilderContext)¶

Builds and updates Curve StableSwap pools.

Thin delegating shell (ADR-005): drives the Rust core’s build_curve_pool (detection choreography + native RpcCurveDataProvider), builds the ERC20 companion tokens, then wraps the registered handle via the single-arg from_handle seam. No Python-side Curve detection remains.

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¶

Construct an I/O-free CurveStableswapPool via the Rust core.

Delegates the full detection + registration to Bot.build_curve_pool (which attaches a native RpcCurveDataProvider and stores the complete identity in Rust state), builds the ERC20 token/LP companions so the handle’s registration-gated getters resolve, then wraps the handle via from_handle.

Returns:

The computed value.

Raises:

BrokenPool – If the pool has fewer than 2 coins.

static update(pool: degenbot.types.abstract.liquidity_pool.AbstractLiquidityPool, *, block_number: degenbot.types.rpc_types.BlockIdentifier | None = None, io: degenbot._ffi.BotIo | None = None) → bool¶

Fetch current state from chain and push update to the pool.

Returns:

The computed value.

Raises:

TypeError – If the operation fails.