NavidCopy of Untitled Query
    Updated 2022-11-24
    with validators as (
    select
    address,
    label,
    raw_metadata[0]['account_address']::string as account
    from
    osmosis.core.dim_labels
    where label_subtype = 'validator'
    ), base as (
    select
    *,b.label as ss,
    case when b.label is not null then 'Validator' else 'User' end as validlbl
    from
    osmosis.core.fact_governance_votes a left join validators b on a.voter=b.account
    )
    select
    description,
    validlbl,
    count(distinct tx_id) as votes,
    count(distinct voter) as voters,
    sum(vote_weight) as weight
    from
    base a join osmosis.core.dim_vote_options b on a.vote_option = b.vote_id
    where
    tx_status='SUCCEEDED' and proposal_id='362'
    group by
    description, validlbl

    Run a query to Download Data