h4wkCEX breakdown
    Updated 2023-04-17
    -- forked from AVAX inflow and outflow @ https://flipsidecrypto.xyz/edit/queries/f3a52f4d-26f3-4b39-9e0c-654ac98dcd06

    with cex_address as (
    select address, initcap(project_name) as project_name
    from crosschain.core.address_labels
    where blockchain = 'avalanche'
    and label_type = 'cex'
    ),

    avax_price as (
    select hour::date as price_date,
    avg(price) as avax_price
    from avalanche.core.fact_hourly_token_prices
    where symbol = 'WAVAX'
    group by 1
    ),

    inflow as (
    select * from avalanche.core.ez_avax_transfers
    join cex_address on eth_from_address = address
    ),

    outflow as (
    select * from avalanche.core.ez_avax_transfers
    join cex_address on eth_to_address = address
    )

    , base as (
    select *, 'Inflow' as type from inflow
    UNION
    select *, 'Outflow' as type from outflow
    )

    select
    date_trunc('week', block_timestamp) as date,
    project_name,
    Run a query to Download Data