BlockTrackeractive vs new contracts
Updated 2025-04-06
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 active vs new contracts @ https://flipsidecrypto.xyz/studio/queries/6394b0dc-84a9-428a-ba2d-bd0a38c06a8f
with contract_list as (
select
distinct to_address as address
from swell.core.fact_traces
where type ilike '%CREATE%'
and TX_SUCCEEDED
and input <> '0x'
and to_address is not null
and ORIGIN_FUNCTION_SIGNATURE <> '0x'
)
,
total_new_contract as (
select
date_trunc('{{granularity}}', first_tx) as date,
count(distinct address) as new_contract
from (
select
to_address as address,
min(block_timestamp) as first_tx
from swell.core.fact_transactions
where 1 = 1
and to_address IN (select address from contract_list)
group by 1
)
group by 1
)
, total_active_contract as (
select
date_trunc('{{granularity}}', block_timestamp) as date,
count(distinct to_address) as active_contract
from swell.core.fact_transactions
where 1=1
and to_address IN (select address from contract_list)
group by 1