Dynamic Data Sources
Dynamic data sources and Substreams
- name: map_pools_created
kind: map
inputs:
- source: sf.ethereum.type.v2.Block
output:
type: proto:uniswap.types.v1.Pools#[substreams::handlers::map]
pub fn map_pools_created(block: Block) -> Result<Pools, Error> {
Ok(Pools {
pools: block
.events::<abi::factory::events::PoolCreated>(&[&UNISWAP_V3_FACTORY])
.filter_map(|(event, log)| {
// skipped: extracting pool information from the transaction
Some(Pool {
address,
token0,
token1,
..Default::default()
})
})
.collect(),
})
}Links
Last updated
Was this helpful?

