Query editor
-- fusi.ng: every launched pool, from the factories' TokenLaunched / MarketOpened events.-- Save this as a Dune VIEW named fusing_pools (Save -> Save as view) so the other queries can-- "select * from dune.<your_team>.result_fusing_pools"; or paste it as a CTE.---- One row per (token, pool_id). A V3 stock-paired launch opens two pools (MarketOpened x2),-- so a token can have more than one row. pair_token = 0x0 means the pool is quoted in ETH.with factories as (select * from (values(0x1550e8Ac48EB9EDaeAEFCC9E84Ba3A445141dB64, 'v1'),(0x595EA7017d4D543C8AbBb82F2365651fD9a3A42f, 'v2'),(0xCB2917b10c0D0Ff6Bd2eD34271f00f356c6D5Ba8, 'v3a'),(0x12E0B74FA72280aCf7748391D9B7D7695715825b, 'v3b'),(0x13b440b49B758A833953bC41A369e194A904ECA4, 'v3c')) as t(factory, release)),launched as (-- TokenLaunched(address indexed token, bytes32 indexed poolId, address indexed deployer,-- address pairToken, uint256 launchConfigId, uint24 poolFee)selectf.release,l.block_time as launched_at,l.tx_hash as launch_tx,bytearray_substring(l.topic1, 13, 20) as token,l.topic2 as pool_id,bytearray_substring(l.topic3, 13, 20) as deployer,bytearray_substring(l.data, 13, 20) as pair_token,0 as market_indexfrom ethereum.logs ljoin factories f on f.factory = l.contract_addresswhere l.topic0 = 0xb6c7b1c782b79bdb5091830e037f9ebc94bdc6e5b07b5cff47220272a2b360e8and l.block_number >= 25949999),markets as (-- MarketOpened(address indexed token, bytes32 indexed poolId, uint8 marketIndex, address pairToken, ...)-- V3 only; the extra pools of a stock-paired launch. The primary pool is already in `launched`.selectf.release,l.block_time as launched_at,l.tx_hash as launch_tx,bytearray_substring(l.topic1, 13, 20) as token,l.topic2 as pool_id,cast(null as varbinary) as deployer,bytearray_substring(l.data, 45, 20) as pair_token,bytearray_to_uint256(bytearray_substring(l.data, 1, 32)) as market_indexfrom ethereum.logs ljoin factories f on f.factory = l.contract_addresswhere l.topic0 = 0x44a1f373c8a81f296a1d9c8aaebd1e5266b4a41abb61b8fda38d5749a0b7ca18and l.block_number >= 26070260),deployers as (select token, min_by(deployer, launched_at) as deployer from launched group by 1)select release, launched_at, launch_tx, token, pool_id, deployer, pair_token, market_index,pair_token = 0x0000000000000000000000000000000000000000 as eth_quotedfrom launchedunion allselect m.release, m.launched_at, m.launch_tx, m.token, m.pool_id, d.deployer, m.pair_token, m.market_index,m.pair_token = 0x0000000000000000000000000000000000000000from markets m