Query editor
withall_v2_reserves_raw_data as (selectcontract_address,call_block_time,output_0from compound_v2_ethereum.cErc20_call_totalReservesunion allselectcontract_address,call_block_time,output_0from compound_v2_ethereum.CErc20Delegator_call_totalReservesunion allselectcontract_address,call_block_time,output_0from compound_v2_ethereum.cEther_call_totalReserves),--cDAI marketdai_v2_market as (select'DAI_V2' as market,date_trunc('day', call_block_time) as time,AVG(output_0 / 1e18) as baseReserveBalanceUsdfrom all_v2_reserves_raw_datawhere contract_address = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643group by contract_address, 2),--cTUSD markettusd_v2_market as (select'TUSD_V2' as market,date_trunc('day', call_block_time) as time,AVG(output_0 / 1e18) as baseReserveBalanceUsdfrom all_v2_reserves_raw_datawhere contract_address = 0x12392F67bdf24faE0AF363c24aC620a2f67DAd86group by contract_address, 2),--cUSDC marketusdc_v2_market as (select'USDC_V2' as market,date_trunc('day', call_block_time) as time,AVG(output_0 / 1e6) as baseReserveBalanceUsdfrom all_v2_reserves_raw_datawhere contract_address = 0x39AA39c021dfbaE8faC545936693aC917d5E7563group by contract_address, 2),--cUSDP marketusdp_v2_market as (select'USDP_V2' as market,date_trunc('day', call_block_time) as time,AVG(output_0 / 1e18) as baseReserveBalanceUsd