Query editor
with Pool_Created AS (SELECTcall_block_time, 'Sonic' AS Chain, output_pool, fee, tokenA, tokenB, call_tx_hashFROM shadow_sonic.RamsesV3Factory_call_createPool aLEFT JOIN shadow_sonic.RamsesV3Factory_evt_PoolCreated b ON b.contract_address = a.contract_addressWHERE call_success = true), All_pools_Data AS (SELECTp.call_block_time, p.output_pool, p.Chain, COALESCE(t1.symbol, 'missing') || '-' || COALESCE(t2.symbol, 'missing') as pair, COALESCE(t1.symbol, 'missing') || '-' || COALESCE(t2.symbol, 'missing') || ' ' || format('%,.2f', p.fee / 1e4) || '%' as pair_fee, t1.decimals AS decimal0, t2.decimals AS decimal1, p.tokenA, p.tokenB, p.call_tx_hashFROM Pool_Created pLEFT JOIN tokens.erc20 t1 ON t1.contract_address = p.tokenALEFT JOIN tokens.erc20 t2 ON t2.contract_address = p.tokenB)SELECTmax(call_block_time), output_pool, Chain, pair, pair_fee, call_tx_hashFROM All_pools_Datagroup by 2,3,4,5,6