SocioCryptoNear vs L1: Tx fee
Updated 2022-07-17
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
›
⌄
SELECT rank()over(ORDER BY daily_avg_fee) as rank,
rank || '-' || label as label,
daily_avg_fee,
sub_label
FROM
(
SELECT 'NEAR' as label,
'NEAR' as sub_label,
date_trunc('day',block_timestamp) as dates,
avg(TRANSACTION_FEE)/pow(10,24) as daily_avg_fee
FROM flipside_prod_db.mdao_near.transactions
WHERE dates >= '2022-01-01'
GROUP BY dates
UNION
SELECT 'Polygon' as label,
'L1' as sub_label,
date_trunc('day',block_timestamp) as dates,
avg(tx_fee) as daily_avg_fee
-- y.matic_price*daily_avg_fee as tx_fee_usd
FROM polygon.core.fact_transactions x
LEFT JOIN (
SELECT date_trunc('day',hour) as date,
avg(price) as matic_price
FROM ethereum.core.fact_hourly_token_prices
WHERE symbol = 'MATIC'
GROUP BY date
) y
ON date_trunc('day',x.block_timestamp) = y.date
WHERE dates >= '2022-01-01'
GROUP BY DATEs
UNION
SELECT 'Ethereum' as label,
'L1' as sub_label,
date_trunc('day',block_timestamp) as dates,
Run a query to Download Data