Query editor
with fund as (select dt, symbol, name,category,price, vc, price_diff, pct_difffrom dune.ahkek.dataset_vc_fundin)-- final as (-- select *-- from (-- select *,-- row_number() over (partition by vc order by dt desc) as days_from_now-- from (-- select dt, vc,-- sum(pct_diff) over (partition by vc order by dt) as cumu_pct_diff,-- sum(pct_diff) over (partition by vc order by dt desc) as cumu_pct_diff_desc-- -- AVG(cast(price as double)) OVER (PARTITION BY vc ORDER BY dt ROWS BETWEEN 14 PRECEDING AND CURRENT ROW) AS moving_avg_7_day-- from fund-- )-- group by 1,2,3,4-- )-- )select dt, vc, pct_diff,round(cast(EXP(SUM(LOG(10, 1 + (cast(pct_diff as double)/100))) OVER (partition by vc ORDER BY dt)) - 1 as double) * 100,4) AS cumulative_return_octfrom fund