walemathsActive Users & Transaction Volume
Updated 2024-07-11
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
›
⌄
WITH active_users AS (
SELECT
tx_from AS user_id,
COUNT(tx_id) AS tx_count,
SUM(gas_used * fee / 1e6) AS total_fees, -- Assuming fees are in micro-units
MAX(block_timestamp) AS last_transaction
FROM
axelar.core.fact_transactions
WHERE
block_timestamp >= DATEADD(day, -30, CURRENT_TIMESTAMP())
AND tx_succeeded = TRUE
GROUP BY
tx_from
),
daily_active_users AS (
SELECT
DATE(last_transaction) AS date,
COUNT(user_id) AS active_user_count,
SUM(tx_count) AS total_transactions,
SUM(total_fees) AS total_fees_paid
FROM
active_users
GROUP BY
DATE(last_transaction)
)
SELECT
date,
active_user_count,
total_transactions,
total_fees_paid
FROM
daily_active_users
ORDER BY
date;
QueryRunArchived: QueryRun has been archived