Query editor
WITH lombard_cumulative_net_flows AS (SELECT"date",chain,SUM(net_lbtc_flow) OVER (PARTITION BY chain ORDER BY "date" ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_net_lbtc_flowFROM query_4443902WHERE "date" >= CAST('2024-08-21' AS DATE)),chain_values AS (SELECTl."date",l.chain,l.cumulative_net_lbtc_flow,l.cumulative_net_lbtc_flow * 3500 AS daily_pointsFROM lombard_cumulative_net_flows l)SELECT"date",chain,cumulative_net_lbtc_flow,daily_points,SUM(daily_points) OVER (PARTITION BY chain ORDER BY "date") AS cumulative_pointsFROM chain_valuesORDER BY "date" DESC, chain;