Afonso_Diazcategorized by active days
Updated 2024-10-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
29
30
31
32
33
34
35
36
›
⌄
with
transactions as (
select
contract_address,
tx_hash,
block_timestamp,
tx_fee,
from_address as user
from
blast.core.fact_event_logs
join
blast.core.fact_transactions using (tx_hash, block_timestamp)
where
tx_status = 'SUCCESS'
),
contracts as (
select
contract_address,
count(distinct block_timestamp::date) as active_days,
count(distinct tx_hash) as transactions,
count(distinct user) as users
from
transactions
where
block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
group by 1
)
select
case
when active_days <= 7 then 'a. 1 days - 1 week'
when active_days <= 14 then 'b. 1 week - 2 weeks'
when active_days <= 30 then 'c. 2 weeks - 1 month'
when active_days <= 90 then 'd. 1 month - 3 months'
QueryRunArchived: QueryRun has been archived