ramishoowUntitled Query
Updated 2023-01-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
WITH SUCCESS_TRANSACTIONS AS ( SELECT BLOCK_TIMESTAMP::DATE AS DAYS, (COUNT(TX_HASH)) AS "Number of successful transactions"
FROM near.core.fact_transactions WHERE DAYS BETWEEN '2022-12-25' AND '2023-01-13' AND TX_STATUS = TRUE
GROUP by DAYS
),
FAILED_TRANSACTIONS AS (
SELECT BLOCK_TIMESTAMP::DATE AS DAYS, (COUNT(TX_HASH)) AS "Number of failed transactions"
FROM near.core.fact_transactions
WHERE DAYS BETWEEN '2022-12-25' AND '2023-01-13' AND TX_STATUS != TRUE
GROUP by DAYS
)
SELECT SUCCESS_TRANSACTIONS.DAYS, 100 - (("Number of failed transactions"/"Number of successful transactions")*100) "Transactions success rate",
"Number of successful transactions", "Number of failed transactions",
CASE
WHEN DAYS BETWEEN '2022-12-25' AND '2022-12-31' THEN 'First week of holidays'
WHEN DAYS BETWEEN '2023-01-01' AND '2023-01-13' THEN 'Second week of holidays'
END AS TYPE
FROM SUCCESS_TRANSACTIONS JOIN FAILED_TRANSACTIONS USING (DAYS)
Run a query to Download Data