Query editor
-- with pre_sets as-- (select-- date_trunc('day', (date_trunc('week', (day) + interval '3' day)) - interval '3' day) AS week,-- --day,-- platform,-- avg(COALESCE(total_supply,0))total_supply,-- avg(COALESCE(total_borrows,0))total_borrows,-- avg(COALESCE(total_liquidity,0))total_liquidity-- from-- (-- SELECT-- day,-- 'Venus Core' as platform,-- sum(case when protocol= 'Venus Finance' then supply else 0 end ) as total_supply,-- sum(case when protocol= 'Venus Finance' then borrow else 0 end ) as total_borrows,-- sum(case when protocol= 'Venus Finance' then supply else 0 end ) - sum(case when protocol= 'Venus Finance' then borrow else 0 end ) as total_liquidity-- FROM (select-- day,-- protocol,-- avg(supply)supply,-- avg(borrow)borrow,-- avg(fees)fees,-- avg(revenue)revenue-- from-- dune.xvslove_team.lending_protocols_data-- group by 1,2-- )-- GROUP BY day-- union-- select-- day,-- type as platform,-- total_supply,-- total_borrows,-- total_liquidity-- from-- query_6813689-- )a-- --WHERE day >= CURRENT_DATE - INTERVAL '90' DAY --- group by 1,2-- )-- select-- week,-- platform,-- total_supply,-- total_borrows,-- total_liquidity,-- (total_supply- LAG(total_supply, 1, 0) OVER (PARTITION BY platform ORDER BY week))*100/LAG(total_supply, 1, 0) OVER (PARTITION BY platform ORDER BY week) as supply_wow_pct,-- (total_borrows- LAG(total_borrows, 1, 0) OVER (PARTITION BY platform ORDER BY week))*100/ LAG(total_borrows, 1, 0) OVER (PARTITION BY platform ORDER BY week) as borrow_wow_pct,-- (total_liquidity - LAG(total_liquidity, 1, 0) OVER (PARTITION BY platform ORDER BY week))*100/ LAG(total_liquidity, 1, 0) OVER (PARTITION BY platform ORDER BY week) as liquidity_wow_pct-- from-- pre_sets-- where week< date_trunc('day', (date_trunc('week', (date(now())) + interval '3' day)) - interval '3' day)-- ORDER BY week desc,platform ASC