Query editor
with assets as (select 'RWA001-A' as collateral, '6S Capital' as collateral_name, 'Real estate' as collateral_typeunion allselect 'RWA002-A' as collateral, 'New Silver' as collateral_name, 'Real estate' as collateral_typeunion allselect 'RWA003-A' as collateral, 'ConsolFreight' as collateral_name, 'Trade Finance' as collateral_typeunion allselect 'RWA004-A' as collateral, 'Harbor Trade Credit' as collateral_name, 'Trade Finance' as collateral_typeunion allselect 'RWA005-A' as collateral, 'FortunaFi' as collateral_name, 'Revenue-based Finance' as collateral_typeunion allselect 'RWA006-A' as collateral, 'Peoples Company' as collateral_name, 'Farmland' as collateral_typeunion allselect 'RWA007-A' as collateral, 'MIP65' as collateral_name, 'Short-term bonds' as collateral_typeunion allselect 'RWA008-A' as collateral, 'OFH - SocGen' as collateral_name, 'Bank' as collateral_typeunion allselect 'RWA009-A' as collateral, 'HVBank' as collateral_name, 'Bank' as collateral_typeunion allselect 'RWA010-A' as collateral, 'Blocktower' as collateral_name, 'Securitization' as collateral_typeunion allselect 'RWA011-A' as collateral, 'Blocktower' as collateral_name, 'Securitization' as collateral_typeunion allselect 'RWA012-A' as collateral, 'Blocktower' as collateral_name, 'Securitization' as collateral_typeunion allselect 'RWA013-A' as collateral, 'Blocktower' as collateral_name, 'Securitization' as collateral_type),lending_assets_1 as (select i as ilk, call_block_time, dart as dart, null as ratefrom makermcd."VAT_call_frob"where call_successand dart <> 0.0union allselect i as ilk, call_block_time, dart as dart, 0.0 as ratefrom makermcd."VAT_call_grab"where call_successand dart <> 0.0union allselect i as ilk, call_block_time, null as dart, rate as ratefrom makermcd."VAT_call_fold"where call_successand rate <> 0.0),-- Find the first usage of an ilkilks as (select ilk, min(call_block_time) as starting_usefrom lending_assets_1group by ilk),-- Generate one 'touch' per ilk per month to avoid holesnoop_filling as (select ilk, d as call_block_time, null::numeric as dart, null::numeric as ratefrom ilkscross join generate_series(starting_use::date, current_date, '1 day') d),lending_assets_1_with_filling as (select * from lending_assets_1union allselect * from noop_filling),