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 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.