select
*,
liquidity_fee / earnings as swapFeeRatio,
block_rewards / earnings as blockRewardsRatio,
sum(block_rewards) over (order by day asc rows between unbounded preceding and current row) as TotalBlockRewards,
sum(liquidity_fee) over (order by day asc rows between unbounded preceding and current row) as TotalSwapsFee
from thorchain.block_rewards
where day <= CURRENT_DATE - 1