Query editor
WITHraw_deposits AS (SELECT * FROM (SELECT 'ETH' AS base_collateral, *FROM basedollar_base.stabilitypool_weth_evt_depositoperationUNION ALLSELECT 'rETH', *FROM basedollar_base.stabilitypool_reth_evt_depositoperationUNION ALLSELECT 'wstETH', *FROM basedollar_base.stabilitypool_wsteth_evt_depositoperationUNION ALLSELECT 'cbBTC', *FROM basedollar_base.stabilitypool_cbbtc_evt_depositoperationUNION ALLSELECT 'cbETH', *FROM basedollar_base.stabilitypool_cbeth_evt_depositoperation)), daily_data AS (SELECTdate(evt_block_time) as date,_depositor as user,SUM((_topUpOrWithdrawal - _depositLossSinceLastOperation - _yieldGainClaimed + _yieldGainSinceLastOperation) / 1e18) AS amountFROM raw_depositsWHERE _depositor NOT IN (0x252b965400862d94bda35fecf7ee0f204a53cc36 -- yUSND)GROUP BY date(evt_block_time), _depositor), intermediary_results AS (SELECT date, user, SUM(amount) OVER (PARTITION BY user ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_amountFROM daily_data), date_series AS (WITH dates AS (SELECT sequence(cast('2025-08-01' as date),cast(date_trunc('day', current_timestamp) AS date),interval '1' day) as d)SELECT date_value as dateFROM datesCROSS JOIN UNNEST(d) AS t(date_value)), users AS (SELECT DISTINCT user FROM intermediary_results), date_user_series AS (SELECT ds.date, p.user