Query editor
withtime_seq as (selectsequence(CAST('2023-11-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)),rates as (selectday,rate,rate_source,lead(day, 1, current_timestamp) OVER (partition by rate_source order BY day asc) as next_dayfrom (selectday,oracle_rate as rate,'oracle' as rate_sourcefromquery_3953744where oracle_rate is not nullunion allselectday,dex_rate as rate,'dex' as rate_sourcefromquery_3953744where dex_rate is not null)),rebase_rates as (selectday,rebase_time,rebase_rate,lead(day, 1, current_timestamp) OVER (order BY day asc) as next_dayfrom (selectday,max_by(rebase_time, (rebase_block, rebase_index)) as rebase_time,max_by(rebase_rate, (rebase_block, rebase_index)) as rebase_ratefrom (selectday,block_time as rebase_time,