gigiokobaKama New weekly Receivers
    Updated 2024-07-28
    WITH KAMA AS (
    SELECT
    Tx_to AS Users,
    SUM(Amount) AS Price_flow,
    MIN(DATE_TRUNC('week', BLOCK_TIMESTAMP)) AS first_week
    FROM
    solana.core.fact_transfers
    WHERE
    Mint = 'HnKkzR1YtFbUUxM6g3iVRS2RY68KHhGV7bNdfF1GCsJB'
    GROUP BY Users

    UNION ALL

    SELECT
    Tx_from AS Users,
    SUM(-Amount) AS Price_flow,
    MIN(DATE_TRUNC('week', BLOCK_TIMESTAMP)) AS first_week
    FROM
    solana.core.fact_transfers
    WHERE
    Mint = 'HnKkzR1YtFbUUxM6g3iVRS2RY68KHhGV7bNdfF1GCsJB'
    GROUP BY Users
    ),
    Tab1 AS(
    SELECT
    Users,
    SUM(Price_flow) AS Receivers,
    MIN(first_week) AS first_week
    FROM
    KAMA
    GROUP BY
    receivers
    HAVING SUM(Price_flow) > 0.01
    ),
    New_receivers AS (
    SELECT
    QueryRunArchived: QueryRun has been archived