Query editor
/* ============================================================================Tsunami — launch leaderboard (top 30 by curve volume)Creator is data word 5 of TokenLaunched; symbol comes from token metadata.Launches come from the launch registry (both TokenLaunched signatures).========================================================================== */WITH launches AS (SELECT launched_at, curve, token, creator,CASE WHEN quote_token IN (0x0000000000000000000000000000000000000000, 0x4200000000000000000000000000000000000006)THEN target_raise END AS target_raise_ethFROM query_9105569),grads AS (SELECT DISTINCT token FROM query_9105569 WHERE graduated),eth_px AS (SELECT timestamp AS hr, price AS px FROM prices.hourWHERE blockchain = 'ink' AND contract_address = 0x4200000000000000000000000000000000000006),trades AS (SELECT l.contract_address AS curve, l.block_time, l.tx_hash,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 (SELECT DISTINCT curve FROM launches) c ON c.curve = l.contract_addressWHERE l.topic0 IN (0x69c2c4bbea56030830cfa2a660af4e5e5f9922742272cac7cccfa1d78f18d568,0xb2888c28870dcbc5cc52fecadfbeeb35cf0b439bfd459ade61b675289c008be0)),agg AS (SELECT t.curve, count(*) AS trades, count(DISTINCT tx."from") AS traders,sum(t.eth) AS vol_eth, sum(t.eth * e.px) AS vol_usd, max(t.block_time) AS last_tradeFROM trades tJOIN ink.transactions tx ON tx.hash = t.tx_hashLEFT JOIN eth_px e ON e.hr = date_trunc('hour', t.block_time)GROUP BY 1)SELECT coalesce(e.symbol, '?') AS symbol,l.launched_at,CASE WHEN g.token IS NOT NULL THEN 'yes' ELSE 'no' END AS graduated,coalesce(a.trades, 0) AS trades,coalesce(a.traders, 0) AS traders,round(coalesce(a.vol_eth, 0), 3) AS volume_eth,round(coalesce(a.vol_usd, 0)) AS volume_usd,round(l.target_raise_eth, 2) AS target_raise_eth,a.last_trade,to_hex(l.token) AS token_address,to_hex(l.creator) AS creatorFROM launches lLEFT JOIN agg a ON a.curve = l.curveLEFT JOIN grads g ON g.token = l.tokenLEFT JOIN tokens.erc20 e ON e.blockchain = 'ink' AND e.contract_address = l.tokenORDER BY volume_usd DESCLIMIT 30