Query editor
WITH base AS (SELECTdate,transaction_digest,sender as owner,CAST(json_extract_scalar(event_json, '$.amount') AS BIGINT) as raw_amount,json_extract_scalar(event_json, '$.lock_id') as lock_idfrom sui.eventswhere event_type = '0xe616397e503278d406e184d2258bcbe7a263d0192cc0848de2b54b518165f832::voting_escrow::EventDeposit'-- where digest = '8FQMgddj7Dd4EA814xhs5ma1xz2h2Wr6P8KcQUWQ94HN')selectcount(distinct transaction_digest) as transactions,count(distinct lock_id) as total_locks,count(distinct owner) as users ,round(sum(raw_amount/1e6),2) as volume,round(avg(raw_amount/1e6),2) as avg_volume_per_tx,round(sum(raw_amount/1e6)/count(distinct owner),2) as avg_volume_per_user,count(distinct transaction_digest) / count(distinct owner) as tx_per_userfrom base