zpokoAvalanche NFT
    Updated 2023-07-03
    -- forked from Avalanche DEX @ https://flipsidecrypto.xyz/edit/queries/28326e78-472b-4759-88fb-717166ba3312

    -- forked from Avalanche @ https://flipsidecrypto.xyz/edit/queries/60d7f5d4-6a8c-49cc-a6c9-be2082e3f45c

    WITH
    query1 AS (
    SELECT
    DATE_TRUNC('day', ft.block_timestamp) AS dt,
    COUNT(
    DISTINCT CASE
    WHEN dl.label_type = 'dex' THEN ft.from_address
    END
    ) AS dex_count,
    COUNT(
    DISTINCT CASE
    WHEN dl.label_type = 'defi' THEN ft.from_address
    END
    ) AS defi_count,
    COUNT(
    DISTINCT CASE
    WHEN dl.label_type = 'dapp' THEN ft.from_address
    END
    ) AS dapp_count,
    COUNT(
    DISTINCT CASE
    WHEN dl.label_type = 'nft' THEN ft.from_address
    END
    ) AS nft_count,
    COUNT(
    DISTINCT CASE
    WHEN dl.label_type = 'layer2' THEN ft.from_address
    END
    ) AS layer2_count
    FROM
    avalanche.core.fact_transactions ft
    JOIN avalanche.core.dim_labels dl ON ft.to_address = dl.address
    Run a query to Download Data