boomer772023-03-08 04:06 PM
Updated 2023-03-08
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
›
⌄
with raw as (select
date_trunc('day', block_date) as dt,
sum(fees_usd) as fees_usd,
case when dt> current_date - 30 then '30days'
when dt > current_date - 60 then '60days'
else '90days' end as timeframe
from osmosis.core.fact_pool_fee_day
where dt>= current_date - 91 and fees_usd > 0
group by 1
order by dt desc),
pools as (select dt, count(distinct pool_id) as pool_available,
SUM(pool_available) OVER(ORDER BY dt asc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_pools
from (
select
pool_id,
min(block_date) as dt
from osmosis.core.fact_pool_fee_day
group by 1)
group by dt),
select dt, fees_usd as current, LAG(fees_usd,1) OVER (ORDER BY dt asc) as prev,
((current/prev)-1)*100 as "Daily Growth Rate%"
from raw
Run a query to Download Data