freemartianBedrock - Personal Saving
Updated 2023-08-30
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 dates as (
select
timestampdiff('day', '2023-06-06 16:00:00.000', current_date) as X_days_after_bedrock,
'2023-06-06 16:00:00.000' as Bedrock_live,
current_date - (2*X_days_after_bedrock) as X_days_before_bedrock
),
source as (
SELECT
from_address,
tx_hash,
tx_fee,
block_timestamp,
(CASE
WHEN block_timestamp < '2023-06-06 16:00:00.000' THEN 'Before Bedrock'
when block_timestamp > '2023-06-06 16:00:00.000' then 'After Bedrock' END
) AS "Label"
FROM optimism.core.fact_transactions
),
pre_average as (
select
avg(tx_fee) as Average_Fee
from source
where "Label" = 'Before Bedrock'),
post_average as (
select
avg(tx_fee) as Average_Fee,
count(tx_hash) as count
from source
where "Label" = 'After Bedrock'
),
post_usage as (
Run a query to Download Data