winnie-fsTest Query for @winnie copy
Updated 2023-04-07
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- 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