Afonso_Diaz2023-06-17 02:28 AM
    Updated 2023-06-16
    with t as (
    select
    date_trunc('month', block_timestamp)::date as month,
    count(distinct tx_id) as proposals,
    sum(proposals) over (order by month) as cumulative_proposals
    from cosmos.core.fact_governance_submit_proposal
    where tx_succeeded = 1
    group by 1
    ),

    t2 as (
    select
    date_trunc('month', block_timestamp)::date as month,
    count(distinct tx_id) as votes,
    count(distinct voter) as voters,
    sum(votes) over (order by month) as cumulative_votes
    from cosmos.core.fact_governance_votes
    where tx_succeeded = 1
    group by 1
    )

    select * from t2
    join t
    using(month)
    order by month
    Run a query to Download Data