Query editor
WITH relevant_transactions AS (SELECT DISTINCTtx_idFROM tokens_solana.transfersWHEREouter_executing_account = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'), solana_pricing AS (SELECTminute AS price_timestamp,price AS sol_usd_rateFROM prices.usdWHEREcontract_address IS NULL AND symbol = 'SOL'), revenue_data AS (SELECTactivity.tx_id,activity.block_time AS transaction_time,activity.address AS signer_address,'Sell' AS transaction_type,activity.balance_change / 1e9 AS sol_amount,(activity.balance_change / 1e9) * pricing.sol_usd_rate AS usd_equivalentFROM solana.account_activity AS activityLEFT JOIN relevant_transactions AS txnsON txns.tx_id = activity.tx_idLEFT JOIN solana_pricing AS pricingON DATE_TRUNC('minute', activity.block_time) = pricing.price_timestampWHEREactivity.block_time >= CURRENT_TIMESTAMP - INTERVAL '24' hourAND activity.balance_change > 0AND activity.token_mint_address IS NULLAND activity.address = 'CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM')SELECT'24h Revenue' AS period,SUM(sol_amount) AS total_sol_revenue_24h,SUM(usd_equivalent) AS total_usd_revenue_24h,COUNT(*) AS transaction_count_24h,MIN(transaction_time) AS period_start,MAX(transaction_time) AS period_endFROM revenue_data