Query editor
WITH stonk_trades AS (SELECTCASE WHEN token_bought_address = 0xe934e36a439c94017b64a3fece66af12099abf50 THEN token_sold_symbol ELSE token_bought_symbol END AS counter_symbol,CASE WHEN token_bought_address = 0xe934e36a439c94017b64a3fece66af12099abf50 THEN token_sold_address ELSE token_bought_address END AS counter_address,CASE WHEN token_bought_address = 0xe934e36a439c94017b64a3fece66af12099abf50 THEN 'buy STONKBROKER' ELSE 'sell STONKBROKER' END AS side,tx_hash,tx_from,amount_usdFROM dex.tradesWHERE blockchain = 'robinhood'AND block_month >= DATE '2026-07-01'AND block_time >= TIMESTAMP '2026-07-17 00:00:00 UTC'AND (token_bought_address = 0xe934e36a439c94017b64a3fece66af12099abf50 OR token_sold_address = 0xe934e36a439c94017b64a3fece66af12099abf50))SELECTCOALESCE(NULLIF(counter_symbol, ''), concat('0x', lower(to_hex(counter_address)))) AS counter_asset,COUNT(DISTINCT tx_hash) AS transactions,COUNT(DISTINCT tx_from) AS wallets,SUM(CASE WHEN side = 'buy STONKBROKER' THEN 1 ELSE 0 END) AS stonk_buy_legs,SUM(CASE WHEN side = 'sell STONKBROKER' THEN 1 ELSE 0 END) AS stonk_sell_legs,ROUND(SUM(amount_usd), 2) AS volume_usdFROM stonk_tradesGROUP BY 1ORDER BY volume_usd DESCLIMIT 20