degenbot.updater.pool_updater_configs ===================================== .. py:module:: degenbot.updater.pool_updater_configs .. autoapi-nested-parse:: Parameterized pool creation event updaters. Module Contents --------------- .. py:data:: UNISWAP_V3_MINT_EVENT_HASH .. py:data:: UNISWAP_V3_BURN_EVENT_HASH .. py:class:: V2PoolUpdateConfig Configuration for a V2-style pool creation event updater. V2 PoolCreated events have: - topics[1]: token0 address - topics[2]: token1 address - topics[3]: (optional) stable bool (Aerodrome) - data: ABI-encoded (pool_address, ?) .. py:attribute:: name :type: str .. py:attribute:: event_hash :type: bytes .. py:attribute:: fee_token0 :type: int .. py:attribute:: fee_token1 :type: int .. py:attribute:: fee_denominator :type: int .. py:attribute:: has_stable_flag :type: bool :value: False .. py:attribute:: rpc_fee_call :type: str | None :value: None .. py:attribute:: rpc_fee_return_types :type: list[str] :value: ['uint256'] .. py:attribute:: rpc_fee_includes_stable :type: bool :value: False .. py:class:: V3PoolUpdateConfig Configuration for a V3-style pool creation event updater. V3 PoolCreated events have: - topics[1]: token0 address - topics[2]: token1 address - topics[3]: fee (uint24) - data: ABI-encoded (tick_spacing, pool_address) .. py:attribute:: name :type: str .. py:attribute:: event_hash :type: bytes .. py:attribute:: fee_denominator :type: int .. py:attribute:: rpc_fee_call :type: str | None :value: None .. py:attribute:: rpc_fee_return_types :type: list[str] :value: ['uint24'] .. py:class:: V4PoolUpdateConfig Configuration for a V4-style pool creation event updater. V4 PoolCreated events have: - topics[1]: pool_hash (bytes32) - topics[2]: currency0 address - topics[3]: currency1 address - data: ABI-encoded (fee, tick_spacing, hooks) .. py:attribute:: name :type: str .. py:attribute:: event_hash :type: bytes .. py:attribute:: fee_denominator :type: int .. py:class:: PoolUpdateRequest[ConfigT: V2PoolUpdateConfig | V3PoolUpdateConfig | V4PoolUpdateConfig] Typed request for one pool-creation event update run. Bundles the block bounds, Rust-backed exchange row, database path, decode config, and event-fetch callable so each updater shell takes a single argument. .. py:attribute:: provider :type: degenbot.provider.AlloyProvider .. py:attribute:: start_block :type: int .. py:attribute:: end_block :type: int .. py:attribute:: exchange :type: degenbot.db.ExchangeRow .. py:attribute:: database_path :type: str .. py:attribute:: config :type: ConfigT .. py:attribute:: get_events_fn :type: collections.abc.Callable[..., list[degenbot.types.rpc_types.LogReceipt]] .. py:function:: update_v2_pools(request: PoolUpdateRequest[V2PoolUpdateConfig]) -> None Process V2-style pool creation events for a DEX. .. py:function:: update_v3_pools(request: PoolUpdateRequest[V3PoolUpdateConfig]) -> None Process V3-style pool creation events for a DEX. .. py:function:: update_v4_pools(request: PoolUpdateRequest[V4PoolUpdateConfig]) -> None Process V4-style pool creation events for a DEX. .. py:function:: apply_v3_liquidity_updates(provider: degenbot.provider.AlloyProvider, pool_address: str, liquidity_events: list[degenbot.types.rpc_types.LogReceipt], exchanges_in_scope: set[degenbot.db.ExchangeRow], *, database_path: str) -> None Apply the V3 liquidity updates to the provided pool. .. py:function:: apply_v4_liquidity_updates(pool_id: bytes, liquidity_events: list[degenbot.types.rpc_types.LogReceipt], pool_manager: degenbot.db.PoolManagerRow, *, database_path: str) -> None Apply the V4 liquidity updates to the provided pool. V4 emits a single signed ``ModifyLiquidity`` event (no Burn/Mint split), so the decode unpacks ``(tick_lower, tick_upper, liquidity_delta, _)`` straight from ``data``. Assumes the liquidity updates are ordered by block number + log index, ascending (the Rust apply enforces the ordering invariant).