articoloquintoActions after unstaking OSMO
    Updated 2022-07-19
    select 're-delegate' as action, count(*) as count from(
    select date, dateadd(day, 1, date) as "date+1", delegator_address as delegator from(
    select block_timestamp as date, DELEGATOR_ADDRESS
    from osmosis.core.fact_staking
    where block_timestamp >= '2022-01-01'
    and action = 'undelegate'
    and TX_STATUS = 'SUCCEEDED'
    UNION
    select block_timestamp as date, DELEGATOR_ADDRESS
    from osmosis.core.fact_superfluid_staking
    where block_timestamp >= '2022-01-01'
    and action = 'SuperfluidUndelegate'
    and TX_STATUS = 'SUCCEEDED')) as d
    inner join(
    select block_timestamp as date, DELEGATOR_ADDRESS as delegator
    from osmosis.core.fact_staking
    where block_timestamp >= '2022-01-01'
    and action = 'redelegate'
    and TX_STATUS = 'SUCCEEDED') as r
    on d.delegator = r.delegator and r.date between d.date and d."date+1"

    union
    select 'provide liquidity' as action, count(*) as count from(
    select date, dateadd(day, 1, date) as "date+1", delegator_address as delegator from(
    select block_timestamp as date, DELEGATOR_ADDRESS
    from osmosis.core.fact_staking
    where block_timestamp >= '2022-01-01'
    and action = 'undelegate'
    and TX_STATUS = 'SUCCEEDED'
    UNION
    select block_timestamp as date, DELEGATOR_ADDRESS
    from osmosis.core.fact_superfluid_staking
    where block_timestamp >= '2022-01-01'
    and action = 'SuperfluidUndelegate'
    and TX_STATUS = 'SUCCEEDED')) as d
    inner join(
    Run a query to Download Data