0xaimanfirepower staked thor
    Updated 2022-05-21

    with
    dox as (select *
    from
    (select tx_from_address, count(date) as n_stake_day

    from
    (select date(t) as date , tx_from_address, sum(nb) as tnb, sum(pb) as tpb, tnb-tpb as stake, case when stake>0 then 'Stake' else 'Doesnt Stake' end as stake_activity
    from (with thor_acn as (select tx_id
    from ethereum.events_emitted
    where --event_name='DelegateVotesChanged' and
    -- tx_id='0x1811392f80a36e6ccf8d1c8e48bcbb92038c280a1a4579a67e9a59f349e6a140' and
    contract_name='thorswap: thor token' and
    event_name='Approval'),

    thor_v as (

    select *
    from ethereum.events_emitted
    where event_name='DelegateVotesChanged' and tx_to_address='0x815c23eca83261b6ec689b60cc4a58b54bc24d8d'
    and block_timestamp>='2022-05-01'
    )

    select thor_acn.tx_id, block_timestamp as t, event_inputs, event_inputs:newBalance/1e18 as nb, event_inputs:previousBalance/1e18 as pb,
    tx_from_address, tx_to_address, contract_address
    from thor_acn
    inner join thor_v on thor_acn.tx_id=thor_v.tx_id)

    group by 1, 2 order by 1
    )
    where stake_activity='Stake'
    group by 1 order by 1)

    where n_stake_day=6),

    Run a query to Download Data