headitmanagerStakers : Top 50 (balances)
    Updated 2022-06-14
    with stakes as (
    select
    origin_address,
    sum(amount) as amount_staked
    from ethereum.udm_events
    where
    to_address = lower('0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84')
    and origin_function_signature IN ('0xa1903eab', '0xa9059cbb') and EVENT_NAME = 'transfer' and BLOCK_TIMESTAMP between '2021-01-01' and '2021-01-30'
    group by 1 order by 2 desc
    limit 50
    )
    select user_address,
    amount_staked,
    balance,
    balance-amount_staked as hold_or_sold,
    case
    when hold_or_sold>0 then 'ADDED'
    when hold_or_sold=0 then 'HOLD'
    when hold_or_sold<0 then 'SOLD'
    end as tiers
    from ethereum.erc20_balances b join stakes s on
    b.user_address = s.origin_address
    where balance_date = '2022-02-28'
    and symbol = 'ETH'
    Run a query to Download Data