Query editor
-- chainlink_multichain.eacaggregatorproxy_call_latestrounddata-- chainlink_ethereum.eacaggregatorproxy_v1_call_getrounddata-- chainlink_ethereum.eacaggregatorproxy_v1_call_latestrounddata-- chainlink_multichain.eacaggregatorproxy_call_latestrounddataWITH getChainLinkPrices AS (SELECT date_trunc('day',call_block_time) as date,'AUDD' as symbol,AVG(output_answer)/1e8 as avg_priceFROM chainlink_ethereum.eacaggregatorproxy_v1_call_latestrounddataWHERE call_success = trueAND call_block_time >= TIMESTAMP '2021-03-14'AND contract_address = 0x77F9710E7d0A19669A13c055F62cd80d313dF022 -- AUD / USDGROUP BY 1,2),getLeadData as (SELECTdate,symbol,avg_price,lead(date, 1, NOW()) OVER (ORDER BY date asc) AS next_hourFROM getChainLinkPrices),generateDates AS(SELECT * FROM UNNEST(sequence(CAST('2021-09-15' AS TIMESTAMP),CAST(NOW() AS TIMESTAMP), interval '1' day)) as t(date)),getDailyPrices as ((SELECTgen.date,symbol,avg_priceFROM getLeadData dataINNER JOIN generateDates genON data.date <= gen.dateAND gen.date < data.next_hour -- Yields an observation for every hour after the first transfer until the next hour with transferORDER BY 1 DESC))select*from getDailyPricesorder by 1 desc