sepehrmhz8Untitled Query
Updated 2022-11-27
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
›
⌄
with swap_hash as (
select distinct tx_hash
from bsc.core.fact_event_logs
where origin_to_address = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57'
), main as (
select
origin_from_address,
min(date_trunc('day', block_timestamp)) as min_day
from bsc.core.fact_token_transfers
left outer join bsc.core.dim_labels
ON contract_address = address
where tx_hash in (select * from swap_hash)
and block_timestamp::date >= '2022-07-10'
group by 1
), final as (
select
min_day,
count(*) as new_users
from main
group by 1
)
select
min_day,
new_users,
sum(new_users) OVER (ORDER BY min_day) as total_users
from final
Run a query to Download Data