Query editor
WITH grok_tokens AS (-- Get all tokens deployed by GROK's address from the token dictionarySELECT *FROM query_4405741 -- The comprehensive token dictionaryWHERE deployer = 0xf70fdba03a86499412142458fb9c931e97fcc887),current_prices AS (-- Use the most recent trade in the last 3 days for current pricingSELECTtoken_address,current_priceFROM (SELECTtoken_sold_address as token_address,amount_usd/token_sold_amount as current_price,ROW_NUMBER() OVER (PARTITION BY token_sold_address ORDER BY block_time DESC) as rnFROM dex.tradesWHERE token_sold_address IN (SELECT tokenAddress FROM grok_tokens)AND block_time >= NOW() - INTERVAL '3' DAYAND amount_usd > 1) tWHERE rn = 1),daily_volume AS (-- Calculate 24h volumeSELECTtoken,SUM(volume) as volume_24hFROM (SELECT token_bought_address as token, amount_usd as volumeFROM dex.tradesWHERE block_time >= NOW() - INTERVAL '24' HOURAND token_bought_address IN (SELECT tokenAddress FROM grok_tokens)UNION ALLSELECT token_sold_address as token, amount_usd as volumeFROM dex.tradesWHERE block_time >= NOW() - INTERVAL '24' HOURAND token_sold_address IN (SELECT tokenAddress FROM grok_tokens))GROUP BY 1),total_volume AS (-- Calculate total volume (all-time)SELECTtoken,SUM(volume) as token_total_volumeFROM (SELECT token_bought_address as token, amount_usd as volumeFROM dex.tradesWHERE token_bought_address IN (SELECT tokenAddress FROM grok_tokens)UNION ALLSELECT token_sold_address as token, amount_usd as volumeFROM dex.trades