K41R0Naleo - 3 copy
Updated 2025-01-09
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 jackguy / aleo - 3 @ https://flipsidecrypto.xyz/jackguy/q/ub-noxklNNSy/aleo---3
with tab1 as (
SELECT
date(block_timestamp) as date,
count(DISTINCT TRIM(SPLIT_PART(SPLIT_PART(fee_msg['transition']['outputs'][0]['value'], '[', 2), ',', 1))) as active_wallets
from aleo.core.fact_transactions
where tx_succeeded
GROUP BY 1
), tab2 as (
SELECT
day,
count(*) as new_wallets,
sum(new_wallets) over (ORDER by day) as total_wallets
from (
SELECT
TRIM(SPLIT_PART(SPLIT_PART(fee_msg['transition']['outputs'][0]['value'], '[', 2), ',', 1)) as wallet,
min(date(block_timestamp)) as day
from aleo.core.fact_transactions
where tx_succeeded
GROUP BY 1
)
group by 1
)
SELECT
*,
active_wallets - new_wallets as returning_wallets
from tab1
left outer join tab2
QueryRunArchived: QueryRun has been archived