rajsUntitled Query
    Updated 2023-01-13
    SELECT
    address,
    sum(amount) as amount,
    sum(amount) / sum(sum(amount)) over () as cum_amount
    FROM
    (
    SELECT
    validator_address as address,
    sum(amount) / pow(10,6) as amount
    from osmosis.core.fact_staking
    where tx_succeeded
    and currency = 'uosmo'
    and action = 'delegate'
    group by 1

    union all

    SELECT
    validator_address as address,
    -sum(amount) / pow(10,6) as amount
    from osmosis.core.fact_staking
    where tx_succeeded
    and currency = 'uosmo'
    and action = 'undelegate'
    group by 1

    union all

    SELECT
    validator_address as address,
    sum(amount) / pow(10,6) as amount
    from osmosis.core.fact_staking
    where tx_succeeded
    and currency = 'uosmo'
    and action = 'redelegate'
    group by 1
    Run a query to Download Data