yasmin-n-d-r-h1EVM
Updated 2023-02-05
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
›
⌄
WITH chain_data AS (
SELECT
'Optimism' AS chain,
trunc(block_timestamp, 'week') AS date,
count(distinct from_address) AS total_unique_users,
count(distinct tx_hash) AS total_transactions,
(count(distinct tx_hash) / 86400) AS tps,
sum(ETH_VALUE) AS amount_eth_volume,
sum(tx_fee) AS total_volume_fees,
count(CASE WHEN status = 'FAIL' THEN 1 END) /
(count(CASE WHEN status = 'FAIL' THEN 1 END) +
count(CASE WHEN status = 'SUCCESS' THEN 1 END)) AS tx_fail_rate
FROM optimism.core.fact_transactions
WHERE block_timestamp >= '2022-01-01'
GROUP BY 1, 2
UNION ALL
SELECT
'Arbitrum' AS chain,
trunc(block_timestamp, 'week') AS date,
count(distinct from_address) AS total_unique_users,
count(distinct tx_hash) AS total_transactions,
(count(distinct tx_hash) / 86400) AS tps,
sum(ETH_VALUE) AS amount_eth_volume,
sum(tx_fee) AS total_volume_fees,
count(CASE WHEN status = 'FAIL' THEN 1 END) /
(count(CASE WHEN status = 'FAIL' THEN 1 END) +
count(CASE WHEN status = 'SUCCESS' THEN 1 END)) AS tx_fail_rate
FROM arbitrum.core.fact_transactions
WHERE block_timestamp >= '2022-01-01'
GROUP BY 1, 2
UNION ALL
SELECT
'Polygon' AS chain,
trunc(block_timestamp, 'week') AS date,
count(distinct from_address) AS total_unique_users,
count(distinct tx_hash) AS total_transactions,
Run a query to Download Data