adriaparcerisasNear report 8
Updated 2024-11-25
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
hourly as (
SELECT
date_trunc('hour', call.block_timestamp) as date,
case when split(split(rc.status_value,':')[0],'{')[1] ilike '%Failure%' then 'Fail execution'
else 'Successful execution' end as type,
COUNT(DISTINCT tr.TX_RECEIVER) as smart_contracts,
sum(smart_contracts) over (partition by type order by date) as cum_smart_contracts
FROM near.core.fact_actions_events_function_call call
INNER JOIN near.core.fact_transactions tr
ON call.TX_HASH = tr.TX_HASH
INNER JOIN near.core.fact_receipts as rc
ON tr.TX_HASH=rc.TX_HASH
WHERE ACTION_NAME = 'FunctionCall'
AND METHOD_NAME <> 'new'
AND date >=CURRENT_DATE-INTERVAL '1 WEEK'
group by 1,2 order by 1 asc,2 desc
),
daily as (
SELECT
date_trunc('day', call.block_timestamp) as date,
case when split(split(rc.status_value,':')[0],'{')[1] ilike '%Failure%' then 'Fail execution'
else 'Successful execution' end as type,
COUNT(DISTINCT tr.TX_RECEIVER) as smart_contracts,
sum(smart_contracts) over (partition by type order by date) as cum_smart_contracts
FROM near.core.fact_actions_events_function_call call
INNER JOIN near.core.fact_transactions tr
ON call.TX_HASH = tr.TX_HASH
INNER JOIN near.core.fact_receipts as rc
ON tr.TX_HASH=rc.TX_HASH
WHERE ACTION_NAME = 'FunctionCall'
AND METHOD_NAME <> 'new'
AND date >=CURRENT_DATE-INTERVAL '1 MONTH'
group by 1,2 order by 1 asc,2 desc
),
weekly as (
QueryRunArchived: QueryRun has been archived