with filter_tx as (
select
*
from solana.transactions
where succeeded = 'TRUE' and date(block_timestamp) >= '2022-01-01'
), unique_tx as (
SELECT
date(block_timestamp) as date,
sum(fee/POW(10,9)) as gas
from filter_tx
group by 1
order by 1 asc
)
select
*,
sum(gas) OVER (ORDER BY date) as cumulative_gas
from unique_tx
order by date asc