Query editor
-- SB Opportunity | Revenue Quality-- Latest complete UTC day only. DEX volume is not revenue.WITHbase AS (SELECT *FROM query_8080407WHERE day < date_trunc('day', current_timestamp)),eth_prices AS (SELECT date(timestamp) AS day, AVG(price) AS eth_price_usdFROM prices.dayWHERE blockchain = 'ethereum'AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2AND timestamp >= TIMESTAMP '2026-07-17 00:00:00 UTC'GROUP BY 1),stonk_price AS (SELECTdate(block_time) AS day,SUM(amount_usd) / NULLIF(SUM(CASEWHEN token_bought_address = 0xe934e36a439c94017b64a3fece66af12099abf50 THEN token_bought_amountELSE token_sold_amountEND), 0) AS stonk_vwap_usdFROM dex.tradesWHERE blockchain = 'robinhood'AND block_time >= TIMESTAMP '2026-07-17 00:00:00 UTC'AND block_time < date_trunc('day', current_timestamp)AND amount_usd > 0AND (token_bought_address = 0xe934e36a439c94017b64a3fece66af12099abf50OR token_sold_address = 0xe934e36a439c94017b64a3fece66af12099abf50)GROUP BY 1),daily AS (SELECTdate(b.day) AS day,b.protocol_revenue_eth,b.activation_protocol_revenue_stonk,p.eth_price_usd,s.stonk_vwap_usd,b.protocol_revenue_eth * p.eth_price_usd AS eth_protocol_revenue_usd,b.activation_protocol_revenue_stonk * s.stonk_vwap_usd AS activation_protocol_revenue_usd,b.protocol_revenue_eth * p.eth_price_usd+ b.activation_protocol_revenue_stonk * s.stonk_vwap_usd AS verified_protocol_revenue_usd,b.amm_active_wallets + b.activation_active_wallets AS module_active_wallet_slots,b.amm_trade_txs,b.new_activations,b.loans_created,b.dex_active_wallets,b.dex_stonk_volume_usdFROM base bLEFT JOIN eth_prices p ON date(b.day) = p.dayLEFT JOIN stonk_price s ON date(b.day) = s.day),stats AS (SELECTSUM(verified_protocol_revenue_usd) AS lifetime_verified_revenue_usd,