maybeyonassushi_weekly_fees
Updated 2021-11-20Copy Reference Fork
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
›
⌄
with
swaps as (
select
block_timestamp,
pool_name,
tx_id,
amount_usd as swap_vol,
0.25*amount_usd/100 as lp_fee,
0.05*amount_usd/100 as stake_fee
from ethereum.dex_swaps
where platform = 'sushiswap'
and amount_usd < pow(10,8)
and amount_usd > 0
)
select
last_day(block_timestamp,'week') weekend,
-- pool_name,
count(tx_id) swaps,
sum(swap_vol) as swap_vol,
sum(lp_fee) as lp_fee,
sum(stake_fee) as stake_fee,
sum(lp_fee)*1000/count(tx_id) as fee_per_1000_swaps
from swaps
-- where platform = 'sushiswap'
-- and amount_usd < pow(10,8)
-- and amount_usd > 0
group by 1--,2
Run a query to Download Data