kiacryptodaily fee info - sushiswap
Updated 2022-10-16
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 token_price as (
select
date_trunc('day', hour) as day,
case when token_address is null then 'ETH' else 'Matic' end as token,
avg(price) as price
from ethereum.core.fact_hourly_token_prices
where token_address is null or token_address = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
group by 1, 2
)
select
date_trunc('week', s.block_timestamp) as date,
sum(tx_fee * price) as fee_usd,
avg(tx_fee * price) as avg_fee_usd,
sum(fee_usd) over (order by date) as cum_fee_usd,
'Arbitrum' as blockchain
from arbitrum.sushi.ez_swaps s join arbitrum.core.fact_transactions t on s.tx_hash = t.tx_hash join token_price on s.block_timestamp::date = day
where token = 'ETH' and platform = 'sushiswap' and event_name = 'Swap' and tx_fee is not null
group by 1
union all
select
date_trunc('week', s.block_timestamp) as date,
sum(tx_fee * price) as fee_usd,
avg(tx_fee * price) as avg_fee_usd,
sum(fee_usd) over (order by date) as cum_fee_usd,
'Optimism' as blockchain
from optimism.sushi.ez_swaps s join optimism.core.fact_transactions t on s.tx_hash = t.tx_hash join token_price on s.block_timestamp::date = day
where token = 'ETH' and platform = 'sushiswap' and tx_fee is not null
group by 1
union all
select
Run a query to Download Data