Afonso_Diaz2023-05-26 07:53 PM
Updated 2023-05-26
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 t as (
select
hour::date as date,
symbol,
avg(price) as price_usd
from ethereum.core.fact_hourly_token_prices
where symbol in ('WFLOW', 'SOL', 'axl')
group by 1, 2
),
t2 as (
select
'Flow' as chain,
count(distinct tx_id) as transactions,
sum(event_data:amount::float * price_usd) as fees_usd,
avg(event_data:amount::float * price_usd) as average_fees_usd,
median(event_data:amount::float * price_usd) as median_fees_usd
from flow.core.fact_events a
join t on a.block_timestamp::date = t.date and t.symbol = 'WFLOW'
where event_type = 'FeesDeducted'
and block_timestamp::date >= current_date - 30
group by 1
union all
select
'Solana' as chain,
count(distinct tx_id) as transactions,
sum((fee/1e9) * price_usd) as fees_usd,
avg((fee/1e9) * price_usd) as average_fees_usd,
median((fee/1e9) * price_usd) as median_fees_usd
from solana.core.fact_transactions a
join t on a.block_timestamp::date = t.date and t.symbol = 'SOL'
where block_timestamp::date >= current_date - 30
group by 1
Run a query to Download Data