eferPolygon Fees 2022
Updated 2023-04-12
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 variables AS (
SELECT
'2022-06-06' AS START_DATE
), polygon_fees AS (
SELECT
BLOCK_TIMESTAMP::date AS date,
SUM(TX_FEE) AS polygon_daily_paid_fees,
AVG(GAS_LIMIT) AS polygon_average_gas_limit,
AVG(GAS_PRICE) AS polygon_average_gas_price,
SUM(polygon_daily_paid_fees) OVER(ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS polygon_cumulative,
COUNT(*) AS polygon_count
FROM polygon.core.fact_transactions
WHERE date >= (SELECT START_DATE FROM variables)
AND TX_FEE is NOT NULL
AND STATUS = 'SUCCESS'
GROUP BY date
), eth_fees AS (
SELECT
BLOCK_TIMESTAMP::date AS date,
SUM(TX_FEE) AS eth_daily_paid_fees,
AVG(GAS_LIMIT) AS eth_average_gas_limit,
AVG(GAS_PRICE) AS eth_average_gas_price,
SUM(eth_daily_paid_fees) OVER(ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS eth_cumulative,
COUNT(*) AS eth_count
FROM ethereum.core.fact_transactions
WHERE date >= (SELECT START_DATE FROM variables)
AND TX_FEE is NOT NULL
AND STATUS = 'SUCCESS'
GROUP BY date
)
SELECT
polygon.date,
polygon.polygon_daily_paid_fees,
eth.eth_daily_paid_fees,
Run a query to Download Data