degenbot.updater.pool_updater_configs¶

Parameterized pool creation event updaters.

Module Contents¶

degenbot.updater.pool_updater_configs.UNISWAP_V3_MINT_EVENT_HASH¶
degenbot.updater.pool_updater_configs.UNISWAP_V3_BURN_EVENT_HASH¶
class degenbot.updater.pool_updater_configs.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, ?)

name: str¶
event_hash: bytes¶
fee_token0: int¶
fee_token1: int¶
fee_denominator: int¶
has_stable_flag: bool = False¶
rpc_fee_call: str | None = None¶
rpc_fee_return_types: list[str] = ['uint256']¶
rpc_fee_includes_stable: bool = False¶
class degenbot.updater.pool_updater_configs.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)

name: str¶
event_hash: bytes¶
fee_denominator: int¶
rpc_fee_call: str | None = None¶
rpc_fee_return_types: list[str] = ['uint24']¶
class degenbot.updater.pool_updater_configs.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)

name: str¶
event_hash: bytes¶
fee_denominator: int¶
class degenbot.updater.pool_updater_configs.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.

provider: degenbot.provider.AlloyProvider¶
start_block: int¶
end_block: int¶
exchange: degenbot.db.ExchangeRow¶
database_path: str¶
config: ConfigT¶
get_events_fn: collections.abc.Callable[..., list[degenbot.types.rpc_types.LogReceipt]]¶
degenbot.updater.pool_updater_configs.update_v2_pools(request: PoolUpdateRequest[V2PoolUpdateConfig]) → None¶

Process V2-style pool creation events for a DEX.

degenbot.updater.pool_updater_configs.update_v3_pools(request: PoolUpdateRequest[V3PoolUpdateConfig]) → None¶

Process V3-style pool creation events for a DEX.

degenbot.updater.pool_updater_configs.update_v4_pools(request: PoolUpdateRequest[V4PoolUpdateConfig]) → None¶

Process V4-style pool creation events for a DEX.

degenbot.updater.pool_updater_configs.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.

degenbot.updater.pool_updater_configs.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).