SELECT
date_trunc('day', block_timestamp) as date,
sum(total_sales_amount) as volume,
sum(volume) over (order by date asc rows between unbounded preceding and current row) as cum_volume
FROM
algorand.nft_sales
WHERE
nft_marketplace = 'rand gallery'
AND
block_timestamp > CURRENT_DATE - 31
group by date
order by date