winnie-fsTest Query for @winnie copy
    Updated 2023-04-07
    -- forked from alitaslimi / Test Query for @winnie @ https://flipsidecrypto.xyz/alitaslimi/q/2023-04-07-11-22-pm-msG-oz

    WITH
    transactions AS (
    SELECT
    block_timestamp::date AS date,
    COUNT(DISTINCT tx_id) AS txn,
    COUNT(DISTINCT proposer) AS users,
    AVG(users) OVER (
    ORDER BY
    date ROWS BETWEEN 20 PRECEDING
    AND CURRENT ROW
    ) as ma_20,
    AVG(users) OVER (
    ORDER BY
    date ROWS BETWEEN 50 PRECEDING
    AND CURRENT ROW
    ) as ma_50,
    AVG(users) OVER (
    ORDER BY
    date ROWS BETWEEN 100 PRECEDING
    AND CURRENT ROW
    ) as ma_100,
    AVG(users) OVER (
    ORDER BY
    date ROWS BETWEEN 200 PRECEDING
    AND CURRENT ROW
    ) as ma_200
    FROM
    flow.core.fact_transactions
    WHERE
    tx_succeeded = TRUE
    GROUP BY
    date
    ),
    suspicious_days AS (
    Run a query to Download Data