MLDZMNscliq1
    Updated 2023-09-02
    -- forked from sc1 @ https://flipsidecrypto.xyz/edit/queries/e0eb256d-af72-4539-afe2-bdd0fbafb07c

    -- forked from type_fee1 @ https://flipsidecrypto.xyz/edit/queries/cd81385a-bb07-44b3-925c-e394ba58c794

    -- forked from lebel1 @ https://flipsidecrypto.xyz/edit/queries/9a89f6a3-52ec-4ce9-8e26-92ada10e93e6

    with t1 as (select
    *

    from avalanche.core.dim_labels
    )

    select
    date_trunc('{{Time_basis}}', BLOCK_TIMESTAMP) as date,
    label_type,
    sum(amount_usd) as volume
    from avalanche.core.ez_avax_transfers s
    left join t1 on s.avax_to_address=t1.ADDRESS
    where BLOCK_TIMESTAMP>=current_date-{{Period}}
    and PROJECT_NAME is not null
    and label_subtype not in ('token_contract')
    and LABEL_TYPE not in ('chadmin','token')
    group by 1,2
    union all
    select
    date_trunc('{{Time_basis}}', BLOCK_TIMESTAMP) as date,
    label_type,
    sum(amount_usd) as volume

    from avalanche.core.ez_token_transfers s
    left join t1 on s.TO_ADDRESS=t1.ADDRESS
    where BLOCK_TIMESTAMP>=current_date-{{Period}}
    and PROJECT_NAME is not null
    and label_subtype not in ('token_contract')
    and LABEL_TYPE not in ('chadmin','token')
    group by 1,2
    Run a query to Download Data