Query editor
withnamed_query as (SELECT*,total as liquidity,total_token0 as HAI_amount,total_token1 as LUSD_amountfrom"query_3914168(pool_address='0x688e9C5290A7df36595169984FcC03f6aB03d5Db',range_min_token0_price_in_token1='0.8', range_max_token0_price_in_token1='1.2')") --,merged as (selecttick,price,casewhen tick % 50 = 0 then SUM(HAI_amount) OVER (ORDER BYtick ROWS BETWEEN CURRENT ROWAND 50 -1 FOLLOWING)else nullend as HAI_amountfromnamed_queryorder bytick)select*,sum(HAI_amount) over (order byprice) as HAI_cumulativefrommergedwhereHAI_amount is not null