hbd1994Voters Average OSMO Balance
    Updated 2022-11-24
    (with maintable as (
    select
    BLOCK_TIMESTAMP,
    TX_ID,
    VOTER,
    VOTE_OPTION,
    DESCRIPTION,
    VOTE_WEIGHT
    from osmosis.core.fact_governance_votes a
    join osmosis.core.dim_vote_options b on b.VOTE_ID =a.VOTE_OPTION
    where PROPOSAL_ID = '362'
    and TX_STATUS = 'SUCCEEDED'),
    validator_balance as(
    select
    voter as "Other Voters",
    (balance/1e6) as "OSMO Balance"
    from osmosis.core.fact_daily_balances
    join maintable on voter = address
    where currency = 'uosmo'
    and voter not in (
    select
    VOTER
    from osmosis.core.fact_governance_votes a
    join osmosis.core.dim_vote_options b on b.VOTE_ID =a.VOTE_OPTION
    join osmosis.core.dim_labels on RAW_METADATA[0]:account_address = voter
    where PROPOSAL_ID = '362'
    and TX_STATUS = 'SUCCEEDED')
    and date < CURRENT_DATE
    and date >= CURRENT_DATE - 1),

    avg_balance as (
    select
    distinct "Other Voters",
    avg("OSMO Balance") as "Average OSMO Balance"
    from validator_balance
    group by 1)
    Run a query to Download Data