freemartianValidators Multi Voters Daily OSMO Balance - Staked & Liquid
    Updated 2022-11-23
    with validators as (
    select
    label,
    raw_metadata[0]['account_address']::string as validator
    from osmosis.core.dim_labels
    where label_subtype = 'validator'
    ),
    votes as (
    select
    voter,
    count(distinct tx_id) as vote_change,
    case
    when vote_option = '1' then 'Yes'
    when vote_option = '2' then 'No'
    when vote_option = '3' then 'Abstain'
    when vote_option = '4' then 'No With VETO'
    end as status
    from osmosis.core.fact_governance_votes
    where proposal_id = '362'
    and TX_STATUS = 'SUCCEEDED'
    group by status, voter)

    select
    date::date as day,
    sum(balance)/pow(10,6) as total_balance,
    balance_type
    from votes v inner join osmosis.core.fact_daily_balances b
    on v.voter = b.address
    where voter in (select validator from validators)
    and date > '2022-11-07' and date < '2022-11-23'
    and currency = 'uosmo'
    and vote_change > 1
    group by balance_type, day
    Run a query to Download Data