Skip to main content

parse_initialize_event_hypersync

Function parse_initialize_event_hypersync 

Source
pub fn parse_initialize_event_hypersync(
    log: HypersyncLog,
) -> Result<PoolCreatedEvent>
Expand description

Parses a UniswapV4 Initialize event from a HyperSync log.

UniswapV4 uses the Initialize event for pool discovery (no separate PoolCreated event). The PoolManager is a singleton contract that manages all V4 pools.

Initialize event signature:

event Initialize(
    PoolId indexed id,          // bytes32 (topic1)
    Currency indexed currency0, // address (topic2)
    Currency indexed currency1, // address (topic3)
    uint24 fee,                // (data)
    int24 tickSpacing,         // (data)
    IHooks hooks,              // address (data)
    uint160 sqrtPriceX96,      // (data)
    int24 tick                 // (data)
);

§Errors

Returns an error if the log parsing fails or if the event data is invalid.

§Panics

Panics if the log address is not set.