Query editor
withinterest_rewards as (selectcasewhen to = 0x7d837bf114785642d225d1101145ddb8af4ba438 then 'WETH'when to = 0xc65a05737d31e0f42c0806c739f3c88dd009c05f then 'wstETH'when to = 0x4eb3b6970fd358d34195b5d40e4eb64e0e3c0b6a then 'rETH'when to = 0x6bd55dd953507641c84a03956760f83d29d65726 then 'cbBTC'when to = 0x25afbb09d9804482ed8e24295be4a12704fe93ea then 'cbETH'end as collateral_type,date_trunc('day', evt_block_time) as day,sum(value/1e18) as bold_amountfrom(select * from basedollar_base.boldtoken_evt_transferwhere contract_address = 0x252d36f435582ecb01686448d21e8c9ea0b2ca65)where to in (0x7d837bf114785642d225d1101145ddb8af4ba438, 0xc65a05737d31e0f42c0806c739f3c88dd009c05f, 0x4eb3b6970fd358d34195b5d40e4eb64e0e3c0b6a, 0x6bd55dd953507641c84a03956760f83d29d65726, 0x25afbb09d9804482ed8e24295be4a12704fe93ea)and "from" = 0x0000000000000000000000000000000000000000group by 1, 2),liquidation_rewards as (selectcollateral_type,date_trunc('day', block_time) as day,sum(collateral_sent_sp) as liquidation_rewardsfromquery_8224344group by 1, 2),time_seq AS (selectsequence(CAST('2026-08-01' as timestamp),date_trunc('day', cast(now() as timestamp)),interval '1' day) as time),days AS (selecttime.time as dayfrom time_seqcross join unnest(time) as time(time)),collaterals as (selectcollateral_typefrom (values('WETH'), ('wstETH'), ('rETH'), ('cbBTC'), ('cbETH')) as tmp (collateral_type)),get_all_collaterals as (selectd.day,