jackguyTop Validator by Votes in 2023 3
    Updated 2023-05-11
    -- forked from The Eclipse Score @ https://flipsidecrypto.xyz/edit/queries/c08da824-6955-4bff-9bcf-145049e4c55f

    WITH tab1 as (
    SELECT
    VALIDATOR as l1,
    COUNT(*) as votes
    FROM osmosis.core.fact_governance_validator_votes
    where created_at > '2023-01-01'
    -- AND block_timestamp > '2022-01-01'
    GROUP by 1
    ), tab2 as (
    SELECT
    VALIDATOR as l2,
    AVG(voting_power) as voting_power
    FROM osmosis.core.fact_governance_validator_votes
    where created_at > '2023-04-01'
    -- WHERE CREATED_AT > '2023-04-01'
    GROUP by 1
    ), tab3 as (
    SELECT
    VALIDATOR as l3,
    -- max(CREATED_AT) -
    MIN(CREATED_AT) AS block_duration
    FROM osmosis.core.fact_governance_validator_votes
    where created_at > '2023-01-01'
    GROUP by 1
    )

    SELECT
    sum(votes),
    avg(votes),
    median(votes),
    avg(voting_power),
    median(voting_power),
    count(DISTINCT validator) as validators
    FROM (
    Run a query to Download Data