saber-jlNakamoto coefficient before prop 196
    Updated 2022-11-02
    with delegate as (select sum(amount/pow(10, 6)) as delegate, VALIDATOR_ADDRESS
    from osmosis.core.fact_staking
    where CURRENCY = 'uosmo'
    and BLOCK_TIMESTAMP < '2022-04-13'
    and ACTION in ('delegate', 'redelegate')
    and TX_STATUS = 'SUCCEEDED'
    group by 2
    order by 1 DESC ),

    undelegate as (select sum(amount/pow(10, 6)) as undelegate, VALIDATOR_ADDRESS
    from osmosis.core.fact_staking
    where CURRENCY = 'uosmo'
    and BLOCK_TIMESTAMP < '2022-04-13'
    and ACTION = 'undelegate'
    and TX_STATUS = 'SUCCEEDED'
    group by 2
    order by 1 DESC),

    total as (
    select sum (delegate - undelegate) as total_voting_power
    from delegate d
    join undelegate u
    on d.VALIDATOR_ADDRESS = u.VALIDATOR_ADDRESS),


    alll as (select d.VALIDATOR_ADDRESS, sum (delegate - undelegate) as voting_power
    from delegate d
    join undelegate u
    on d.VALIDATOR_ADDRESS = u.VALIDATOR_ADDRESS

    where delegate > undelegate
    group by 1
    order by 2 desc),

    cum as (select VALIDATOR_ADDRESS, voting_power,
    sum(voting_power) over (order by voting_power desc) as cum_power,
    Run a query to Download Data