MLDZMNcomp2
Updated 2023-03-29
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 tb1 as (select
HOUR::date as day,
avg(PRICE) as price_token
from ethereum.core.fact_hourly_token_prices where SYMBOL='WETH'
group by 1),
tb2 as (select
HOUR::date as day,
avg(PRICE) as price_token
from ethereum.core.fact_hourly_token_prices where SYMBOL='MATIC'
group by 1),
tb3 as (select
HOUR::date as day,
avg(PRICE) as price_token
from ethereum.core.fact_hourly_token_prices where SYMBOL='WAVAX'
group by 1)
select
date_trunc('day',BLOCK_TIMESTAMP) as date,
'Polygon' as chain,
count(distinct tx_hash) as no_txn,
count(distinct FROM_ADDRESS) as no_users,
sum(TX_FEE*price_token) as paid_fee,
avg(tx_fee*price_token) as avg_fee,
median(tx_fee*price_token) as median_fee,
min(TX_FEE*price_token) as min_usd,
max(TX_FEE*price_token) as max_usd
from Polygon.core.fact_transactions s left join tb2 b on s.BLOCK_TIMESTAMP::date=b.day
where STATUS='SUCCESS' and block_timestamp>=current_date- {{Time_period}}
group by 1
Run a query to Download Data