Yousefi_1994 Re-Delegate or Swap or LP position for OSMO after Undelegate in last 6 month (More accurate)
    Updated 2022-07-18
    with first_undelegate as (
    select
    delegator_address as wallet,
    min(block_timestamp) as first_undelegate_time,
    avg(amount/1e6) as undelegate_amount
    from osmosis.core.fact_staking
    where tx_status = 'SUCCEEDED'
    and action = 'undelegate'
    and block_timestamp >= current_date - 180
    group by wallet
    order by first_undelegate_time
    ),
    first_delegate as (
    select
    delegator_address as wallet,
    min(block_timestamp) as first_delegate_time,
    avg(amount/1e6) as delegate_amount
    from osmosis.core.fact_staking
    where tx_status = 'SUCCEEDED'
    and action = 'delegate'
    and block_timestamp >= current_date - 180
    group by wallet
    order by first_delegate_time
    ),
    first_swap as (
    select
    trader as wallet,
    min(block_timestamp) as first_swap_time,
    avg(from_amount/1e6) as swap_amount
    from osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and from_currency = 'uosmo'
    and block_timestamp >= current_date - 180
    group by wallet
    order by first_swap_time
    ),
    Run a query to Download Data