MasiAverage Votes
    Updated 2023-01-26
    with tb1 as ( select trunc(block_timestamp,'day') as day,
    case when day < '2023-01-14' then 'Pre-Station'
    when day > '2023-01-14' then 'Post-Station'
    when day = '2023-01-14' then 'Terra Station Launch' end as status,
    voter,
    count(DISTINCT tx_id) as count_tx
    from terra.core.fact_governance_votes
    where day >= CURRENT_DATE - 30
    and TX_SUCCEEDED = 'TRUE'
    group by 1,2,3)
    ,
    tb2 as ( select day,
    status,
    count(DISTINCT voter) as count_voter,
    avg(count_tx) as average_vote_per_user,
    sum(count_tx) as count_votes
    from tb1
    group by 1,2)

    select status,
    avg(count_voter) as average_voter_per_day,
    avg(count_votes) as average_votes_per_day,
    avg(average_vote_per_user) as average_vote_per_user
    from tb2
    group by 1
    Run a query to Download Data