feyikemiNear report 4 copy
Updated 2024-07-22
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 adriaparcerisas / Near report 4 @ https://flipsidecrypto.xyz/adriaparcerisas/q/iEboWYFFFQpT/near-report-4
WITH
near as (
Select
trunc(block_timestamp,'hour') as date,
count(distinct tx_hash) as txs,
txs/1440 as tpm
From near.core.fact_transactions
Where block_timestamp::date >=current_date - INTERVAL '1 WEEK'
Group by 1
order by 1 ASC
),
near_fail as (
Select
trunc(block_timestamp,'hour') as date,
count(distinct tx_hash) as failed_txs
From near.core.fact_transactions
Where block_timestamp::date >=CURRENT_DATE - INTERVAL '1 WEEK'
and tx_succeeded<>TRUE
Group by date
order by date ASC
),
hourly as (
SELECT
x.date,
txs,
failed_txs,
txs-failed_txs as succeeded_txs,
(failed_txs/txs)*100 as pcg_failed,
(succeeded_txs/txs)*100 as pcg_succeeded
from near x, near_fail y where x.date=y.date
),
near2 as (
Select
trunc(block_timestamp,'day') as date,
QueryRunArchived: QueryRun has been archived