Yousefi_1994Growth of The Number of Users
Updated 2024-12-03
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
›
⌄
WITH FIRST_ACTIVITY_OF_USERS AS (
SELECT
EVENT_DATA:sender AS ADDRESS,
MIN(BLOCK_TIMESTAMP::DATE) AS FIRST_ACTIVITY
FROM aptos.core.fact_events
WHERE
EVENT_TYPE ILIKE '0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3::controller::DepositEvent%'
AND EVENT_DATA:repay_only = false
AND SUCCESS = TRUE
GROUP BY ADDRESS
),
USERS_GROWTH AS (
SELECT
FIRST_ACTIVITY AS "Date",
COUNT(ADDRESS) AS "Number of new users",
SUM("Number of new users") OVER (ORDER BY "Date") AS "Total Number of Users"
FROM FIRST_ACTIVITY_OF_USERS
GROUP BY "Date"
),
FIRST_ACTIVITY_BORROWERS AS(
SELECT
EVENT_DATA:sender AS ADDRESS,
MIN(BLOCK_TIMESTAMP::DATE) AS FIRST_ACTIVITY
FROM aptos.core.fact_events
WHERE
EVENT_TYPE ILIKE '0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3::controller::WithdrawEvent%'
AND EVENT_DATA:allow_borrow = true
AND SUCCESS = TRUE
GROUP BY ADDRESS
),
BORROWERS_GROWTH AS (
QueryRunArchived: QueryRun has been archived