freemartianStaking action
    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
    )
    select count(s.delegator_address) , action, sum(amount)/pow(10,6), min(block_timestamp)
    from osmosis.core.fact_staking s
    inner join undelegation u on s.delegator_address = u.delegator_address
    where s.block_timestamp > u.osmo_receive_time
    group by action
    Run a query to Download Data