Pine AnalyticsSEI Contracts 5
Updated 2024-04-10
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 SEI Contracts 3 @ https://flipsidecrypto.xyz/edit/queries/7e581104-fec9-491a-b1c3-5453e2ca9bb6
with tab1 as (
select
date(block_timestamp) as date,
tx_id,
TX_SUCCEEDED,
ATTRIBUTE_VALUE as contract_address
from
sei.core.FACT_MSG_ATTRIBUTES
where
msg_type = 'instantiate'
and ATTRIBUTE_KEY = '_contract_address'
and TX_SUCCEEDED = 'True'
), tab2 as (
SELECT
date,
tab1.tx_id,
contract_address,
tx_from
FROM tab1
LEFT outer JOIN sei.core.fact_transactions as a
on a.tx_id = tab1.tx_id
), tab3 as (
SELECT
tx_from,
-- date,
-- CASE when label_type is NULL then 'Unlabeled Contract' else label_type end as contract_type,
count(*) as new_contracts,
min(date) as first_time
from tab2
GROUP BY 1
)
SELECT
Auto-refreshes every 24 hours
QueryRunArchived: QueryRun has been archived