RayyykNumber of wallets re-delegate to validators
    Updated 2022-07-17
    with table_1 as (select min(block_timestamp :: date) as initian_unstake,
    delegator_address
    from osmosis.core.fact_staking
    where tx_status = 'SUCCEEDED'
    and currency = 'uosmo'
    and action = 'undelegate'
    group by 2),

    table_2 as (select validator_address,
    count(distinct(b.delegator_address)) as wallet_count
    from osmosis.core.fact_staking a
    join table_1 b on a.delegator_address = b.delegator_address
    where block_timestamp :: date > initian_unstake
    and tx_status = 'SUCCEEDED'
    and currency = 'uosmo'
    and action = 'redelegate'
    group by 1)

    select validator_address,
    wallet_count
    from table_2
    order by 2
    Run a query to Download Data