shreyash-5873LUNA Unstaking Addresses by Date
    Updated 2021-11-20
    select
    *,
    delegation_address_count - undelegation_address_count as net_delegation_address_count
    from (select
    date(block_timestamp) as block_date,
    count(distinct delegator_address) as delegation_address_count
    from terra.staking
    where action = 'delegate'
    and block_date > date('2021-05-01')
    and tx_status = 'SUCCEEDED'
    group by 1) a
    inner join
    (select
    date(block_timestamp) as block_date,
    count(distinct delegator_address) as undelegation_address_count
    from terra.staking
    where action = 'undelegate'
    and block_date > date('2021-05-01')
    and tx_status = 'SUCCEEDED'
    group by 1) b
    on a.block_date = b.block_date

    Run a query to Download Data