Madismart contracts
Updated 2023-01-01Copy Reference Fork
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
›
⌄
-- I took part of quiery from mhm quiery and changed it a little for using in UXUI
with succ as (
select date_trunc('day',block_timestamp) as date, sum(smart_contracts) as succ_contract from (
select
call.block_timestamp as block_timestamp,
count(distinct tr.TX_RECEIVER) as 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 split(split(rc.status_value, ':')[0], '{')[1] ilike '%Success%'
and METHOD_NAME = 'new' and call.block_timestamp >= '2022-12-01'
group by 1) where date >= '2022-12-01' group by 1
),
fail as (select date_trunc('day',block_timestamp) as date, sum(smart_contracts) as failed_contract from (
select
call.block_timestamp as block_timestamp,
count(distinct tr.TX_RECEIVER) as 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
Run a query to Download Data