Query editor
-- =============================================================================-- Emerge Creator Fees by Token — Daily Stacked Bar + Cumulative Line-- (Clanker v4, Base only)-- X-axis: date | Stacked bars: creator fees USD per token_symbol | Line: cumulative total-- =============================================================================WITHemerge_tokens AS (SELECTtokenAddress AS token_address,tokenSymbol AS token_symbol,msgSender AS creatorFROM clanker_v4_multichain.clanker_evt_tokencreatedWHERE chain = 'base'AND json_extract_scalar(tokenContext, '$.interface') = 'Emerge'),fees_raw AS (SELECTtoken,feeOwner,amount,DATE(evt_block_time) AS fee_dateFROM clanker_v4_multichain.clankerfeelocker_evt_storetokensWHERE chain = 'base'AND token IN (SELECT token_address FROM emerge_tokens)),-- ----------------------------------------------------------------------------- USD price derivation-- ---------------------------------------------------------------------------dex_swaps AS (SELECTtoken, paired_token, token_amount, paired_token_amount, swap_date,ROW_NUMBER() OVER (PARTITION BY token, swap_date ORDER BY block_time DESC) AS rnFROM (SELECTtoken_bought_address AS token, token_sold_address AS paired_token,token_bought_amount AS token_amount, token_sold_amount AS paired_token_amount,block_time, DATE(block_time) AS swap_dateFROM dex.tradesWHERE blockchain = 'base'AND token_bought_address IN (SELECT token_address FROM emerge_tokens)AND token_bought_amount > 0 AND token_sold_amount > 0UNION ALLSELECTtoken_sold_address AS token, token_bought_address AS paired_token,token_sold_amount AS token_amount, token_bought_amount AS paired_token_amount,block_time, DATE(block_time) AS swap_dateFROM dex.tradesWHERE blockchain = 'base'AND token_sold_address IN (SELECT token_address FROM emerge_tokens)AND token_bought_amount > 0 AND token_sold_amount > 0) swaps),latest_swap AS (SELECT token, paired_token, token_amount, paired_token_amount, swap_dateFROM dex_swaps WHERE rn = 1),