Afonso_Diaz2023-06-13 07:37 PM
    Updated 2023-06-16
    with t as (
    select
    'Near' as chain,
    count(distinct tx_hash) as votes,
    count(distinct args:id) as proposals,
    count(distinct signer_id) as voters
    from near.core.fact_actions_events_function_call
    left outer join near.core.dim_address_labels
    on address = receiver_id
    where method_name = 'act_proposal'
    and label_type = 'dao'
    and creator = 'Near Foundation'
    group by 1

    union all

    select
    'Cosmos' as chain,
    count(distinct b.tx_id) as votes,
    count(distinct a.tx_id) as proposals,
    count(distinct voter) as voters
    from cosmos.core.fact_governance_submit_proposal a
    join cosmos.core.fact_governance_votes b
    where a.tx_succeeded = 1
    group by 1

    union all

    select
    'Osmosis' as chain,
    count(distinct b.tx_id) as votes,
    count(distinct a.tx_id) as proposals,
    count(distinct voter) as voters
    from osmosis.core.fact_governance_submit_proposal a
    join osmosis.core.fact_governance_votes b
    where a.tx_succeeded = 1
    Run a query to Download Data