degenbot.aerodrome.pools ======================== .. py:module:: degenbot.aerodrome.pools .. autoapi-nested-parse:: Aerodrome V2 liquidity pool implementations (volatile and stable). Module Contents --------------- .. py:class:: AerodromeV2Pool(*args: Any, **kwargs: Any) Bases: :py:obj:`degenbot.aerodrome.v2_pool_state.AerodromeV2PoolState`, :py:obj:`degenbot.aerodrome.v2_pool_calc.AerodromeV2PoolCalc`, :py:obj:`degenbot.types.abstract.AbstractLiquidityPool` AerodromeV2Pool class. .. py:attribute:: variant :type: ClassVar[str | None] :value: 'aerodrome' .. py:type:: PoolState :canonical: AerodromeV2PoolState .. py:attribute:: FEE_DENOMINATOR :value: 10000 .. py:attribute:: address :type: degenbot.types.chain.ChecksummedAddress .. py:attribute:: factory :type: degenbot.types.chain.ChecksummedAddress .. py:attribute:: deployer_address :type: degenbot.types.chain.ChecksummedAddress .. py:attribute:: name :type: str .. py:method:: from_handle(py_pool: degenbot.types.Pool) -> Self :classmethod: 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. .. py:property:: reserves_token0 :type: int Reserves token0. .. py:property:: reserves_token1 :type: int Reserves token1. .. py:property:: state :type: PoolState State. :raises DegenbotValueError: If the Rust snapshot is absent. .. py:property:: update_block :type: degenbot.types.aliases.BlockNumber Update block. .. py:method:: swap_is_viable(state: PoolState, vector: degenbot.uniswap.types.UniswapPoolSwapVector) -> bool :staticmethod: Swap is viable. :returns: The computed boolean value. .. py:method:: external_update(update: degenbot.aerodrome.types.AerodromeV2PoolExternalUpdate) -> None External update. :raises ExternalUpdateError: See function documentation. .. py:method:: discard_states_before_block(block: degenbot.types.aliases.BlockNumber) -> None Discard cached states earlier than the given block. :raises NoPoolStateAvailable: See function documentation. .. py:method:: 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. .. py:class:: AerodromeV3Pool(*args: Any, **kwargs: Any) Bases: :py:obj:`degenbot.uniswap.v3_liquidity_pool.UniswapV3Pool` AerodromeV3Pool class. .. py:attribute:: variant :type: ClassVar[str | None] :value: 'aerodrome' .. py:type:: PoolState :canonical: AerodromeV3PoolState .. py:attribute:: TICK_STRUCT_TYPES :value: ('uint128', 'int128', 'int128', 'uint256', 'uint256', 'uint256', 'int56', 'uint160', 'uint32', 'bool')