kasadeghUntitled Query
Updated 2022-08-03
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 deployed_smart_contracts as
(
select RECEIVER_ID as contract_name
,e.TX_HASH
,e.BLOCK_TIMESTAMP::date contract_creation_date
from near.core.fact_actions_events as e
join near.core.fact_receipts as r
on e.TX_HASH=r.TX_HASH
where ACTION_NAME='DeployContract'
and STATUS_VALUE like '%Success%'
and e.block_timestamp >=
CASE lower({{please_select_time_period?}})
WHEN 'last_day' THEN DATEADD(day,-1,CURRENT_DATE)
WHEN 'last_week' THEN DATEADD(day,-7,CURRENT_DATE)
WHEN 'last_month' THEN DATEADD(day,-30,CURRENT_DATE)
WHEN 'last_3_month' THEN DATEADD(day,-90,CURRENT_DATE)
WHEN 'year_2022' THEN '2022-01-01'
WHEN 'overall' THEN '2018-01-01'
ELSE '2022-01-01'
END
)
,
contract_creation_date as
(
select contract_name,
min(contract_creation_date) as contract_first_creation_date
from deployed_smart_contracts
group by contract_name
)
select day,
total_unique_deployed_contracts-lag(total_unique_deployed_contracts) over (order by day) as daily_unique_deployed_contracts_count
from
(
select day, max(total_unique_deployed_contracts) as total_unique_deployed_contracts
Run a query to Download Data