saeedmznOsmosis Governance - avg days to active
    Updated 2022-06-20
    with wallets as (select tx_from as wallet, min(block_timestamp::date) as start_date
    from osmosis.core.fact_transactions
    group by 1),

    votes as (select voter, min(block_timestamp::date) as first_vote_date
    from osmosis.core.fact_governance_votes
    where tx_status = 'SUCCEEDED'
    group by 1),

    days as (select wallet, datediff('day', start_date, first_vote_date) as days_to_active
    from wallets w
    join votes v on w.wallet = v.voter)

    select avg(days_to_active) as average_duration
    from days
    Run a query to Download Data