ludicrousSOL fee month copy
    Updated 2024-08-28
    WITH ProgramInteractions AS (
    SELECT
    t.wallet_id,
    SUM(t.amount_SOL) AS total_SOL_used
    FROM
    transactions t
    WHERE
    t.program_id = 'SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE'
    AND t.timestamp > '2024-07-01'
    AND t.timestamp < '2024-08-01'
    GROUP BY
    t.wallet_id
    )

    -- Join with wallets to get wallet addresses (optional, depending on your needs)
    SELECT
    w.wallet_address,
    pi.total_SOL_used
    FROM
    ProgramInteractions pi
    JOIN
    wallets w
    ON
    pi.wallet_id = w.wallet_id
    ORDER BY
    pi.total_SOL_used DESC;
    QueryRunArchived: QueryRun has been archived