SpecterTOP L2: OP
Updated 2024-09-14
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 last_7_days AS (
SELECT block_timestamp, tx_hash,
from_address, value, tx_fee_precise, to_address
FROM ethereum.core.fact_transactions
WHERE to_address IN ('0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc', '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1')
AND status = 'SUCCESS'
AND block_timestamp >= DATEADD(day, -7, CURRENT_DATE())
),
overall AS (
SELECT block_timestamp, tx_hash,
from_address, value, tx_fee_precise
FROM ethereum.core.fact_transactions
WHERE to_address IN ('0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc', '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1')
AND status = 'SUCCESS'
)
-- Last 7 days totals
SELECT
'Last 7 Days' AS period,
COUNT(DISTINCT tx_hash) AS Total_tx,
COUNT(DISTINCT from_address) AS bridgers,
SUM(value) AS total_value,
SUM(tx_fee_precise) AS total_tx_fee
FROM last_7_days
UNION ALL
-- Overall totals
SELECT
'Overall' AS period,
COUNT(DISTINCT tx_hash) AS Total_tx,
COUNT(DISTINCT from_address) AS bridgers,
SUM(value) AS total_value,
SUM(tx_fee_precise) AS total_tx_fee
FROM overall;
QueryRunArchived: QueryRun has been archived