Query editor
with stusds_p as (select max(chi) / 1e27 as price, evt_block_date as day from sky_ethereum.stusds_evt_drip group by 2),prices as (selectday,greatest(max(case when contract_address = 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD then p.price else 1 end), 1) as susds_p,greatest(max(case when contract_address = 0x83F20F44975D03b1b09e64809B757c47f942BEeA then p.price else 1 end), 1) as sdai_p,arbitrary(stusds_p.price) as stusds_pfrom (selectavg(price) as price,date_trunc('day', timestamp) as day,contract_addressfrom prices.hourwhere contract_address in (0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD, -- susds0x83F20F44975D03b1b09e64809B757c47f942BEeA, -- sdai0x99cd4ec3f88a45940936f469e4bb72a2a701eeb9 -- stusds)and blockchain = 'ethereum'and timestamp > date '2023-01-01'group by 2, 3) p left join stusds_p using(day)group by day)select to_unixtime(day) as date_unix, * from prices