MLDZMNnftliq1
    Updated 2023-09-02
    -- forked from dexliq1 @ https://flipsidecrypto.xyz/edit/queries/115fa34d-5bc7-4fc4-b950-206b2a5767df

    with t1 as (select
    *

    from avalanche.core.dim_labels
    )

    select
    date_trunc('{{Time_basis}}', BLOCK_TIMESTAMP) as date,
    PROJECT_NAME,
    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_TYPE in ('nft')
    and label_subtype not in ('token_contract')
    group by 1,2
    union all
    select
    date_trunc('{{Time_basis}}', BLOCK_TIMESTAMP) as date,
    PROJECT_NAME,
    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_TYPE in ('nft')
    and label_subtype not in ('token_contract')
    group by 1,2


    Run a query to Download Data