degenbot.aerodrome.pools¶
Aerodrome V2 liquidity pool implementations (volatile and stable).
Module Contents¶
- class degenbot.aerodrome.pools.AerodromeV2Pool(*args: Any, **kwargs: Any)¶
Bases:
degenbot.aerodrome.v2_pool_state.AerodromeV2PoolState,degenbot.aerodrome.v2_pool_calc.AerodromeV2PoolCalc,degenbot.types.abstract.AbstractLiquidityPoolAerodromeV2Pool class.
- type PoolState = AerodromeV2PoolState¶
- FEE_DENOMINATOR = 10000¶
- deployer_address: degenbot.types.chain.ChecksummedAddress¶
- classmethod from_handle(py_pool: degenbot.types.Pool) Self¶
Wrap a Rust-owned
Poolhandle as a Python companion.Internal seam (ADR-005, Polars-style
_from_pydfpattern). Every identity field (address, tokens, factory, fee, stable, variant) is read off the handle; reserves live in Rust (AerodromeV2PoolState) and are read viasnapshot_aerodrome()— the PythonStateCacheis gone.- Returns:
A
clsinstance wrappingpy_pool.- Raises:
DegenbotValueError – If the handle is not an Aerodrome V2 pool.
- property state: PoolState¶
State.
- Raises:
DegenbotValueError – If the Rust snapshot is absent.
- property update_block: degenbot.types.aliases.BlockNumber¶
Update block.
- static swap_is_viable(state: PoolState, vector: degenbot.uniswap.types.UniswapPoolSwapVector) bool¶
Swap is viable.
- Returns:
The computed boolean value.
- external_update(update: degenbot.aerodrome.types.AerodromeV2PoolExternalUpdate) None¶
External update.
- Raises:
ExternalUpdateError – See function documentation.
- discard_states_before_block(block: degenbot.types.aliases.BlockNumber) None¶
Discard cached states earlier than the given block.
- Raises:
NoPoolStateAvailable – See function documentation.
- restore_state_before_block(block: degenbot.types.aliases.BlockNumber) None¶
Restore the last pool state recorded prior to a target block.
Use this method to maintain consistent state data following a chain re-organization.
- Raises:
NoPoolStateAvailable – See function documentation.
- class degenbot.aerodrome.pools.AerodromeV3Pool(*args: Any, **kwargs: Any)¶
Bases:
degenbot.uniswap.v3_liquidity_pool.UniswapV3PoolAerodromeV3Pool class.
- type PoolState = AerodromeV3PoolState¶
- TICK_STRUCT_TYPES = ('uint128', 'int128', 'int128', 'uint256', 'uint256', 'uint256', 'int56', 'uint160', 'uint32', 'bool')¶