mucrypto2023-05-26 07:55 PM
    Updated 2023-05-26
    with inflow as (select
    block_timestamp::date as day,
    sum(amount) as amount_inflow,
    'Inflow' as category_inflow,
    to_address
    from ethereum.core.ez_token_transfers
    where block_timestamp::date between '2021-10-13' and current_date()
    and to_address = '0x78605df79524164911c144801f41e9811b7db73d' -- BitDAO treasury
    and contract_address = '0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5' --BIT
    group by 1,4),

    outflow as (select
    block_timestamp::date as day,
    -sum(amount) as amount_outflow,
    'Outflow' as category_outflow,
    from_address
    from ethereum.core.ez_token_transfers
    where block_timestamp::date between '2021-10-13' and current_date()
    and from_address = '0x78605df79524164911c144801f41e9811b7db73d' -- BitDAO treasury
    and contract_address = '0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5' --BIT
    group by 1,4)

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

    -- total as (
    -- select
    -- to_address
    -- from ethereum.core.ez_token_transfers)

    select
    *
    Run a query to Download Data