yasminSupplied USER TX New USER
Updated 2024-10-05
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 NEWUSER AS (
SELECT
sender_id,
CASE
WHEN ACTIONS IN ('deposit', 'deposit_to_reserve') THEN 'deposit'
WHEN ACTIONS = 'withdraw_succeeded' THEN 'withdraw'
ELSE ACTIONS
END AS action_type,
MIN(date_trunc('MONTH', block_timestamp)) AS first_tx
FROM
near.defi.ez_lending
WHERE
SYMBOL IN ('DAI', 'USDC', 'USDt', 'USDT.e', 'FRAX', 'USDC.e')
AND PLATFORM = 'burrow'
AND ACTIONS IN ('borrow', 'repay', 'deposit', 'deposit_to_reserve', 'withdraw_succeeded')
GROUP BY
sender_id,
action_type)
SELECT
first_tx AS date,
action_type AS action,
COUNT(DISTINCT sender_id) AS "new users"
FROM
NEWUSER
GROUP BY
first_tx,
action_type
ORDER BY
first_tx,
action_type;
QueryRunArchived: QueryRun has been archived