Skip to main content
Use the factory pattern when you need to index events from contracts that are deployed dynamically by a known factory contract — for example, Uniswap V3 pools created by the UniswapV3Factory.
The examples below use typegen-generated ABI modules. See Specifying events for how to generate them from a JSON ABI.

Basic factory

Track events from contracts created by a factory. The contractFactory() helper discovers child contracts from the factory’s creation events and maintains the address list in a local SQLite database.

Filtering factory events

To narrow which child contracts are tracked, pass an event object with a params field. Only creation events matching the specified parameter values are stored — unmatched contracts are ignored at both the portal and the local database level.
Filter rules:
  • Only indexed parameters can be used for filtering.
  • Multiple parameters are combined with AND logic.
  • Passing an array of values for a parameter matches any of them (OR logic).
  • Address matching is case-insensitive.

Including factory event data

DecodedEvent<T, F> carries a .factory field with the creation event. Use it when you need to include factory context (e.g. pool token addresses) alongside each decoded event.

Multiple factories

Pass separate evmEventDecoder outputs to track contracts from different factory addresses in a single pipeline.