kentovivacious-salmon
Updated 2025-03-01
999
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 blockchain_data AS (
-- Arbitrum
SELECT
'Arbitrum' AS blockchain,
COUNT(*) AS total_transactions,
MIN(BLOCK_TIMESTAMP) AS start_time,
MAX(BLOCK_TIMESTAMP) AS end_time,
SUM(TX_FEE) AS total_tx_fees,
AVG(GAS_PRICE_BID) AS avg_gas_price,
SUM(CASE WHEN TX_SUCCEEDED = TRUE THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS success_rate
FROM
arbitrum.core.fact_transactions
WHERE
BLOCK_TIMESTAMP >= '2023-02-01' AND BLOCK_TIMESTAMP < '2023-03-01'
UNION ALL
-- BSC
SELECT
'BSC' AS blockchain,
COUNT(*) AS total_transactions,
MIN(BLOCK_TIMESTAMP) AS start_time,
MAX(BLOCK_TIMESTAMP) AS end_time,
SUM(TX_FEE) AS total_tx_fees,
AVG(GAS_PRICE) AS avg_gas_price,
SUM(CASE WHEN TX_SUCCEEDED = TRUE THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS success_rate
FROM
bsc.core.fact_transactions
WHERE
BLOCK_TIMESTAMP >= '2023-02-01' AND BLOCK_TIMESTAMP < '2023-03-01'
UNION ALL
-- Ethereum
SELECT
'Ethereum' AS blockchain,
QueryRunArchived: QueryRun has been archived