Query editor
WITH deposit_events AS (-- Track deposits into voting moduleSELECTevt_block_time,evt_tx_hash,amount,"from" as userFROM shadow_sonic.VoteModule_evt_DepositWHERE evt_block_time >= CURRENT_DATE - INTERVAL '30' day),delegate_events AS (-- Track delegation eventsSELECTevt_block_time,evt_tx_hash,delegator,delegateeFROM shadow_sonic.VoteModule_evt_DelegateWHERE evt_block_time >= CURRENT_DATE - INTERVAL '30' day),reward_events AS (-- Track reward claimsSELECTevt_block_time,evt_tx_hash,"from" as user,amount as reward_amountFROM shadow_sonic.VoteModule_evt_ClaimRewardsWHERE evt_block_time >= CURRENT_DATE - INTERVAL '30' day),withdraw_events AS (-- Track withdrawalsSELECTevt_block_time,evt_tx_hash,"from" as user,amount as withdraw_amountFROM shadow_sonic.VoteModule_evt_WithdrawWHERE evt_block_time >= CURRENT_DATE - INTERVAL '30' day),daily_stats AS (-- Calculate daily voting statisticsSELECTdate_trunc('day', d.evt_block_time) as date,-- Deposit metricsCOUNT(DISTINCT d.evt_tx_hash) as deposit_count,COUNT(DISTINCT d.user) as unique_depositors,SUM(CAST(d.amount AS double) / POWER(10, 18)) as total_deposited,-- Delegation metricsCOUNT(DISTINCT del.evt_tx_hash) as delegation_count,COUNT(DISTINCT del.delegator) as unique_delegators,COUNT(DISTINCT del.delegatee) as unique_delegatees,-- Reward metricsCOUNT(DISTINCT r.evt_tx_hash) as reward_claim_count,