yasmin-n-d-r-hall table join
    Updated 2023-04-13
    WITH
    transactions AS (
    SELECT
    tx_id,
    DATE_TRUNC('month', block_timestamp) AS month
    FROM
    flow.core.fact_transactions
    )
    SELECT
    month,
    COUNT(
    DISTINCT CASE
    WHEN ez_nft_sales.tx_id IS NOT NULL THEN transactions.tx_id
    END
    ) AS nft_tx_count,
    COUNT(
    DISTINCT CASE
    WHEN ez_swaps.tx_id IS NOT NULL THEN transactions.tx_id
    END
    ) AS swap_tx_count,
    COUNT(
    DISTINCT CASE
    WHEN ez_staking_actions.tx_id IS NOT NULL THEN transactions.tx_id
    END
    ) AS staking_tx_count,
    COUNT(
    DISTINCT CASE
    WHEN ez_bridge_transactions.tx_id IS NOT NULL THEN transactions.tx_id
    END
    ) AS bridge_tx_count,
    COUNT(
    DISTINCT CASE
    WHEN ez_token_transfers.tx_id IS NOT NULL THEN transactions.tx_id
    END
    ) AS transfer_tx_count
    FROM
    Run a query to Download Data