Afonso_DiazContract Retention Analysis
Updated 2025-02-15
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
with last_activity as (
select
contract_address,
max(date_trunc('day', block_timestamp)) as last_active_date
from flow.core_evm.fact_event_logs
where tx_succeeded
group by contract_address
)
select
case
when last_active_date >= current_date - interval '30 days' then 'Active Contracts'
when last_active_date between current_date - interval '90 days' and current_date - interval '30 days' then 'Dormant Contracts'
else 'Inactive Contracts'
end as contract_status,
count(contract_address) as contract_count
from last_activity
group by contract_status
QueryRunArchived: QueryRun has been archived