Afonso_Diaz2023-05-26 08:39 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,
tx_id,
event_data:amount::float * price_usd as fee_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
union all
select
'Solana' as chain,
tx_id,
(fee/1e9) * price_usd as fee_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
union all
select
'Osmosis' as chain,
tx_id,
(case
Run a query to Download Data