cypherOsmosis decentralization
    Updated 2022-11-06
    --Props 114, 196 & 337 were all passed in an effort to promote decentralization within the ecosystem.
    --After these proposals, how was governance impacted by this effort?

    --Analyze the participation of the new validators on the governance proposals after the active set increases.
    --Did new validators vote more or less than the original top 66% of validators?
    --Did time play a factor? Analyze changes in governance participation t+30,+60,+90 days after these proposals.

    -- Payout 105.042 OSMO

    -- ACTIONS:
    -- determine new and old validatars: 100 old vs 50 new since props 114
    -- Analyse voting participation for new and old validators: did new validators vote more or less than the orignial top 66% of validators
    --

    -- select
    -- min(block_timestamp) as first_time,
    -- validator_address
    -- from osmosis.core.fact_staking
    -- group by validator_address
    -- order by first_time asc

    WITH DELEGATED_AMOUNT AS (
    SELECT DATE_TRUNC('DAY', BLOCK_TIMESTAMP) AS DAY,
    VALIDATOR_ADDRESS,
    SUM(AMOUNT/POW(10,DECIMAL)) AS DELEGATED_AMOUNT
    FROM osmosis.core.fact_staking
    WHERE ACTION='delegate'
    AND TX_STATUS='SUCCEEDED'
    GROUP BY DAY, VALIDATOR_ADDRESS
    ),

    REDELEGATED_AMOUNT AS (
    SELECT DATE_TRUNC('DAY', BLOCK_TIMESTAMP) AS DAY,
    REDELEGATE_SOURCE_VALIDATOR_ADDRESS,
    SUM(AMOUNT/POW(10,DECIMAL)) AS REDELEGATED_AMOUNT
    FROM osmosis.core.fact_staking
    Run a query to Download Data