boomer77Undelegations
    Updated 2021-08-20
    with undel as
    (select
    date_trunc('day',block_timestamp) as block_day, action, validator_address, sum(event_amount) as LUNA_staked, concat('-', LUNA_staked) as undelegate
    from terra.staking
    where tx_status = 'SUCCEEDED' and action = 'undelegate'
    group by 1,2,3
    order by 1 desc),

    labelA as
    (select delegator_address, label, operator_address, vp_address
    from
    terra.validator_labels)

    select A.validator_address, sum(A.undelegate), B.label
    from undel A
    join labelA B on A.validator_address = B.operator_address
    group by 1,3
    order by 2 asc
    limit 20
    Run a query to Download Data