tkvresearchFriend3 I Revenue
Updated 2023-11-27
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
›
⌄
with
A as ( select date_trunc('week',date) as date, chain,
sum(fees) as fees ,
sum(revenue) as revenue
from external.defillama.fact_protocol_fees_revenue
where protocol = 'Friend3'
GROUP by 1,2),
B as(
select date,
CASE when chain = 'bsc' then 'BNBChain L1' else 'opBNB L2' end as chain,
fees as "Weekly fees",
revenue as "Weekly revenue",
sum(fees) over (partition by chain order by date) as "Total Fees",
sum(revenue) over (partition by chain order by date) as "Total Revenue",
sum(fees) over (order by date) as "Total fees all",
sum(revenue) over (order by date) as "Total revenue all"
from A)
select * from B
order by 1 desc, 2
Run a query to Download Data