shawnedwardsAAVE staked and unstaked
    Updated 2022-08-10
    (select 'stake' as activity,
    count(distinct tx_hash) as transaction_count,
    coalesce(sum(amount),0) as amount,
    coalesce (sum(amount_usd),0) as amount_usd
    from ethereum.core.ez_token_transfers
    where lower (origin_to_address) = '0x4da27a545c0c5b758a6ba100e3a049001de870f5' and
    lower (to_address) = '0x4da27a545c0c5b758a6ba100e3a049001de870f5' and
    block_timestamp >= '2022-01-01' and block_timestamp <= current_date - 1
    and symbol = 'AAVE')
    union all
    (select 'unstake' as activity,
    count(distinct tx_hash) as transaction_count,
    coalesce(sum(amount),0) as amount, coalesce (sum(amount_usd),0) as amount_usd
    from ethereum.core.ez_token_transfers
    where lower (origin_to_address) = '0x4da27a545c0c5b758a6ba100e3a049001de870f5'
    and lower (from_address) = '0x4da27a545c0c5b758a6ba100e3a049001de870f5'
    and block_timestamp >= '2022-01-01' and block_timestamp <= current_date - 1
    and symbol = 'AAVE')


    Run a query to Download Data