Query editor
withbalances as (select * from dune.virady.result_permissionless_yield_market_demand_v_2_materialized),-- sdai-- susds-- aethusdc-- aethusdt-- syrupusdc-- susde-- steakhouse morpho usdcmorphoprice as (select-- usdc to wei conversion factoravg(output_0 * 1e12 / shares) as price,call_block_date as day,contract_addressfrom metamorpho_vaults_ethereum.metamorpho_call_converttoassetswhere contract_address = 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CBand shares > 0and call_block_date > date '2025-12-23'group by 2, 3),prices as (selectday,max(case when contract_address = 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD then price else 1 end) as susds_p,max(case when contract_address = 0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c then price else 1 end) as aethusdc_p,max(case when contract_address = 0x23878914efe38d27c4d67ab83ed1b93a74d4086a then price else 1 end) as aethusdt_p,max(case when contract_address = 0x83F20F44975D03b1b09e64809B757c47f942BEeA then price else 1 end) as sdai_p,max(case when contract_address = 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497 then price else 1 end) as susde_p,max(case when contract_address = 0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b then price else 1 end) as syrupusdc_pfrom (selectavg(price) as price,date_trunc('day', timestamp) as day,contract_addressfrom prices.hourwhere contract_address in (0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD, -- susds-- 0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c, -- aethusdc (should be 1)-- 0x23878914efe38d27c4d67ab83ed1b93a74d4086a, -- aethusdt (should be 1)0x83F20F44975D03b1b09e64809B757c47f942BEeA, -- sdai0x9D39A5DE30e57443BfF2A8307A4256c8797A3497, -- susde0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b -- syrupusdc)and blockchain = 'ethereum'and timestamp > date '2023-01-01'group by 2, 3union all select * from morphoprice)group by day)selectday,to_unixtime(day) as date_unix,sky_susds * coalesce(susds_p, 1) as sky_susds,-- sky_sdai * coalesce(sdai_p, 1) as sky_sdai,aave_aethusdc * coalesce(aethusdc_p, 1) as aave_aethusdc,