degenbot.uniswap.v2_pool_state ============================== .. py:module:: degenbot.uniswap.v2_pool_state .. autoapi-nested-parse:: State mixin for V2-style constant-product pools. Holds all data attributes (immutable and mutable) and their properties. No calculation logic — calculations live in UniswapV2PoolCalc. This mixin is designed to be composed with: - UniswapV2PoolCalc (calculation methods) - AbstractLiquidityPool (address, name, simulate_swap) Pools with different state shapes (e.g., Aerodrome's unidirectional fee and stable flag) define their own state mixin instead of using this one. Module Contents --------------- .. py:class:: V2PoolState State for V2-style constant-product pools with directional fees. Matches the Uniswap V2 contract's data model: - token0, token1: the paired ERC-20 tokens (immutable) - fee_token0, fee_token1: directional swap fees (immutable) - reserves_token0, reserves_token1: current reserves (mutable via external_update) - block: last update block number (mutable via external_update) All attributes are set by the concrete pool's __init__. Properties provide read access; mutation happens through external_update(). .. py:property:: token0 :type: degenbot.erc20.Erc20Token Token0. .. py:property:: token1 :type: degenbot.erc20.Erc20Token Token1. .. py:property:: fee_token0 :type: fractions.Fraction Fee token0. .. py:property:: fee_token1 :type: fractions.Fraction Fee token1. .. py:property:: fee :type: tuple[fractions.Fraction, fractions.Fraction] The pool fees as a tuple (fee_token0, fee_token1). .. py:property:: tokens :type: tuple[degenbot.erc20.Erc20Token, degenbot.erc20.Erc20Token] Tokens.