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

AerodromeV2Pool class.

variant: ClassVar[str | None] = 'aerodrome'¶
type PoolState = AerodromeV2PoolState¶
FEE_DENOMINATOR = 10000¶
address: degenbot.types.chain.ChecksummedAddress¶
factory: degenbot.types.chain.ChecksummedAddress¶
deployer_address: degenbot.types.chain.ChecksummedAddress¶
name: str¶
classmethod from_handle(py_pool: degenbot.types.Pool) → Self¶

Wrap a Rust-owned Pool handle as a Python companion.

Internal seam (ADR-005, Polars-style _from_pydf pattern). Every identity field (address, tokens, factory, fee, stable, variant) is read off the handle; reserves live in Rust (AerodromeV2PoolState) and are read via snapshot_aerodrome() — the Python StateCache is gone.

Returns:

A cls instance wrapping py_pool.

Raises:

DegenbotValueError – If the handle is not an Aerodrome V2 pool.

property reserves_token0: int¶

Reserves token0.

property reserves_token1: int¶

Reserves token1.

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

AerodromeV3Pool class.

variant: ClassVar[str | None] = 'aerodrome'¶
type PoolState = AerodromeV3PoolState¶
TICK_STRUCT_TYPES = ('uint128', 'int128', 'int128', 'uint256', 'uint256', 'uint256', 'int56', 'uint160', 'uint32', 'bool')¶