select block_timestamp::date as fecha,
split(pool_name, '-')[0] as pool,
sum(liq_fee_in_rune_e8)/pow(10,8) as fees,
sum(fees) over (partition by pool order by fecha) as cum_fees
from thorchain.swap_events
where fecha < CURRENT_DATE
group by 1,2
order by 1 desc