kentodecisive-magenta
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 transaction_metrics AS (
SELECT
DATE(BLOCK_TIMESTAMP) AS date,
'arbitrum' AS blockchain,
COUNT(TX_HASH) AS total_transactions,
COUNT(TX_HASH) / NULLIF(EXTRACT(EPOCH FROM MAX(BLOCK_TIMESTAMP)) - EXTRACT(EPOCH FROM MIN(BLOCK_TIMESTAMP)), 0) AS transactions_per_second,
AVG(GAS_USED) AS avg_gas_used_per_tx,
SUM(GAS_USED) AS total_gas_used,
SUM(TX_FEE) AS total_fees_paid,
AVG(TX_FEE) AS avg_transaction_fee,
COUNT(DISTINCT FROM_ADDRESS) + COUNT(DISTINCT TO_ADDRESS) AS total_unique_wallets,
SUM(CASE WHEN TX_SUCCEEDED = FALSE THEN 1 ELSE 0 END) AS failed_transactions
FROM arbitrum.core.fact_transactions
WHERE BLOCK_TIMESTAMP BETWEEN '2025-02-01'::TIMESTAMP AND '2025-03-01'::TIMESTAMP
GROUP BY 1, 2
UNION ALL
SELECT
DATE(BLOCK_TIMESTAMP) AS date,
'bsc' AS blockchain,
COUNT(TX_HASH) AS total_transactions,
COUNT(TX_HASH) / NULLIF(EXTRACT(EPOCH FROM MAX(BLOCK_TIMESTAMP)) - EXTRACT(EPOCH FROM MIN(BLOCK_TIMESTAMP)), 0) AS transactions_per_second,
AVG(GAS_USED) AS avg_gas_used_per_tx,
SUM(GAS_USED) AS total_gas_used,
SUM(TX_FEE) AS total_fees_paid,
AVG(TX_FEE) AS avg_transaction_fee,
COUNT(DISTINCT FROM_ADDRESS) + COUNT(DISTINCT TO_ADDRESS) AS total_unique_wallets,
SUM(CASE WHEN TX_SUCCEEDED = FALSE THEN 1 ELSE 0 END) AS failed_transactions
FROM bsc.core.fact_transactions
WHERE BLOCK_TIMESTAMP BETWEEN '2025-02-01'::TIMESTAMP AND '2025-03-01'::TIMESTAMP
GROUP BY 1, 2
UNION ALL
SELECT
QueryRunArchived: QueryRun has been archived