datavortexTotal Transactions
Updated 2024-11-17
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
›
⌄
WITH yearly_transactions AS (
SELECT
block_timestamp,
tx_hash
FROM near.core.fact_transactions
WHERE block_timestamp >= '2024-01-01'
AND block_timestamp < '2025-01-01'
),
weekly_transactions AS (
SELECT
DATE_TRUNC('week', block_timestamp) AS "Week Start Date",
COUNT(DISTINCT tx_hash) AS "Total Transactions"
FROM yearly_transactions
GROUP BY 1
),
cumulative_transactions AS (
SELECT
"Week Start Date",
"Total Transactions",
SUM("Total Transactions") OVER (ORDER BY "Week Start Date") AS "Cumulative Transactions"
FROM weekly_transactions
)
SELECT
"Week Start Date",
"Total Transactions",
"Cumulative Transactions"
FROM cumulative_transactions;
QueryRunArchived: QueryRun has been archived