freemartianTop 10 Redelegate Validators
    Updated 2022-07-19
    with undelegation as (
    select
    delegator_address,
    min(completion_time) as osmo_receive_time
    from osmosis.core.fact_staking
    where action = 'undelegate'
    and block_timestamp > '2022-01-01'
    group by delegator_address
    ),

    next_transactions as (
    select tx_from, tx_id, block_timestamp
    from osmosis.core.fact_transactions t
    inner join undelegation u on u.delegator_address = t.tx_from
    where t.block_timestamp > u.osmo_receive_time
    ),

    first_move as (
    select tx_from, tx_id, min(block_timestamp)
    from next_transactions
    group by tx_from, tx_id
    )

    select count(distinct fm.tx_id) as count, VALIDATOR_ADDRESS
    from osmosis.core.fact_staking m
    inner join first_move fm on fm.tx_id = m.tx_id
    where action = 'redelegate'
    group by VALIDATOR_ADDRESS
    order by count DESC
    limit 10
    Run a query to Download Data