degenbot.curve.stableswap_pool_state¶

State mixin for Curve StableSwap pools.

Holds immutable data attributes and read-only properties that access them. No calculation logic — calculations stay in CurveStableswapPool.

The state mixin follows the same pattern as V2PoolState and V3PoolState: underscore-prefixed private attributes set by the concrete pool’s __init__, with public @property accessors defined here.

Curve StableSwap state is significantly different from V2/V3/V4: - Multiple tokens (not just 2) - A coefficient (amplification parameter) with ramping - Strategy enums for variant computation - CurveDataProvider for on-chain data access - Block-scoped caches for rate/virtual price data

Module Contents¶

class degenbot.curve.stableswap_pool_state.StableswapPoolState¶

State for Curve StableSwap pools.

Immutable data set at construction: - _tokens: the pool’s ERC-20 tokens (2 or more) - Configuration attributes (a_coefficient, fee, admin_fee, etc.) - Strategy enums and variant computation selectors

All attributes are set by the concrete pool’s __init__. Properties provide read access; mutation happens through external_update().

property tokens: tuple[degenbot.erc20.Erc20Token, ...]¶

Tokens.

property a_coefficient: int¶

A coefficient.

property fee: int¶

Fee.

property admin_fee: int¶

Admin fee.

property rate_multipliers: tuple[int, ...]¶

Rate multipliers.

property precision_multipliers: tuple[int, ...]¶

Precision multipliers.

property base_pool: degenbot.curve.curve_stableswap_liquidity_pool.CurveStableswapPool | None¶

Base pool.

property tokens_underlying: tuple[degenbot.erc20.Erc20Token, ...] | None¶

Tokens underlying.

property lp_token: degenbot.erc20.Erc20Token¶

Lp token.

property use_lending: tuple[bool, ...]¶

Use lending.

property initial_a_coefficient: int | None¶

Initial a coefficient.

property future_a_coefficient: int | None¶

Future a coefficient.

property initial_a_coefficient_time: int | None¶

Initial a coefficient time.

property future_a_coefficient_time: int | None¶

Future a coefficient time.

property fee_gamma: int¶

Fee gamma.

property mid_fee: int¶

Mid fee.

property out_fee: int¶

Out fee.

property gamma: int¶

Gamma.

property offpeg_fee_multiplier: int¶

Offpeg fee multiplier.

property name: str¶

Name.