mucrypto2023-05-23 11:54 PM
    Updated 2023-05-24
    with inflow as (select
    block_timestamp::date as day,
    sum(amount) as amount,
    'inflow' as category
    from ethereum.core.ez_eth_transfers
    where block_timestamp::date <= current_date -7
    and eth_to_address = '0x78605df79524164911c144801f41e9811b7db73d'
    group by 1),

    outflow as (select
    block_timestamp::date as day,
    -sum(amount) as amount,
    'outflow' as category
    from ethereum.core.ez_eth_transfers
    where block_timestamp::date <= current_date -7
    and eth_from_address = '0x78605df79524164911c144801f41e9811b7db73d'
    group by 1),

    total_flow as (
    select *
    from inflow
    union all
    select *
    from outflow)

    select
    day,
    amount,
    category

    from total_flow
    Run a query to Download Data