Query editor
/* ============================================================================Tsunami — daily launches, graduations, curve volume and traders(fork of tydro/8807766)----------------------------------------------------------------------------Changed from the original: launches and graduations come from the launchregistry (both TokenLaunched signatures, both factories), so the 19 legacylaunches before the 2026-09-14 upgrade are no longer dropped. Volume is thequote leg in ETH: TokenBought.amount (gross in) on buys, TokenSold.amountOut(net out) on sells. Non-ETH-quoted curves are excluded from the ETH/USDvolume here; Q6 has all-asset USD volume.========================================================================== */WITH launches AS (SELECT * FROM query_9105569),eth_px AS (SELECT timestamp AS hr, price AS px FROM prices.hourWHERE blockchain = 'ink' AND contract_address = 0x4200000000000000000000000000000000000006),trades AS (SELECT l.block_time, l.tx_from,CASE WHEN l.topic0 = 0x69c2c4bbea56030830cfa2a660af4e5e5f9922742272cac7cccfa1d78f18d568THEN 'buy' ELSE 'sell' END AS side,CASE WHEN l.topic0 = 0x69c2c4bbea56030830cfa2a660af4e5e5f9922742272cac7cccfa1d78f18d568THEN cast(bytearray_to_uint256(l.topic1) AS double)ELSE cast(bytearray_to_uint256(bytearray_substring(l.data, 1, 32)) AS double)END / 1e18 AS ethFROM ink.logs lJOIN launches la ON la.curve = l.contract_addressWHERE l.topic0 IN (0x69c2c4bbea56030830cfa2a660af4e5e5f9922742272cac7cccfa1d78f18d568,0xb2888c28870dcbc5cc52fecadfbeeb35cf0b439bfd459ade61b675289c008be0)AND l.block_number >= 54686019AND la.quote_token IN (0x0000000000000000000000000000000000000000, 0x4200000000000000000000000000000000000006)),daily_trades AS (SELECT date_trunc('day', t.block_time) AS day,count(*) AS curve_trades,count_if(t.side = 'buy') AS buys,count_if(t.side = 'sell') AS sells,count(DISTINCT t.tx_from) AS traders,sum(t.eth) AS volume_eth,sum(t.eth * e.px) AS volume_usdFROM trades tLEFT JOIN eth_px e ON e.hr = date_trunc('hour', t.block_time)GROUP BY 1),daily_launches AS (SELECT date_trunc('day', launched_at) AS day, count(*) AS launches FROM launches GROUP BY 1),daily_grads AS (SELECT date_trunc('day', graduated_at) AS day, count(*) AS graduations FROM launches WHERE graduated GROUP BY 1)SELECT coalesce(t.day, l.day, g.day) AS day,coalesce(l.launches, 0) AS launches,coalesce(g.graduations, 0) AS graduations,coalesce(t.curve_trades, 0) AS curve_trades,coalesce(t.buys, 0) AS buys,coalesce(t.sells, 0) AS sells,coalesce(t.traders, 0) AS traders,round(coalesce(t.volume_eth, 0), 3) AS volume_eth,round(coalesce(t.volume_usd, 0)) AS volume_usd