dariustay_0512Polygon and Ethereum cumulative fees — Daily
Updated 2022-10-15
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
›
⌄
WITH poly_fees AS (
SELECT
date(block_timestamp) AS date,
avg(tx_fee) AS avg_fee,
sum(tx_fee) AS total_daily_fee,
sum(total_daily_fee) OVER (ORDER BY date) AS cumulative_fee
FROM polygon.core.fact_transactions
WHERE status = 'SUCCESS'
GROUP BY 1
),
eth_fees AS (
SELECT
date(block_timestamp) AS date,
avg(tx_fee) AS avg_fee,
sum(tx_fee) AS total_daily_fee,
sum(total_daily_fee) OVER (ORDER BY date) AS cumulative_fee
FROM ethereum.core.fact_transactions
WHERE status = 'SUCCESS'
GROUP BY 1
)
SELECT
p.date AS "Date",
p.cumulative_fee AS "Polygon cumulative fee (MATIC)",
e.cumulative_fee AS "Ethereum cumulative fee (ETH)"
FROM poly_fees p
JOIN eth_fees e on p.date = e.date
WHERE p.date BETWEEN '2022-06-30' AND '2022-07-08'
ORDER BY 1;
Run a query to Download Data