Query editor
with base_collat as (select *from query_3957464where blockchain = 'base'-- and action = 'borrow'-- and loan_symbol = 'USDC'-- and borrow_amount_usd < 0-- and time >= date '2025-03-30'-- limit 1000),total_user as (select count(distinct usr) as total_collatersfrom base_collatwhere action = 'collat'and collateral_symbol = 'USDC'and collat_amount_usd > 0)select *,sum(collaterals) over (order by month) as total_collaterals,sum(collat_volume) over (order by month) as total_collat_volume,total_collatersfrom (selectdate_trunc('month', time) as month,count(distinct usr) as user,count(*) as collaterals,sum(collat_amount_usd) as collat_volume,count(distinct loan_symbol) as assets_loanedfrom base_collatwhere action = 'collat'and collateral_symbol = 'USDC'and collat_amount_usd > 0group by 1)left join total_useron 1 = 1order by 1 desc