Query editor
with oracles as (select evt_block_time, fToken as flux_token_address, newPricefrom fluxfinance_ethereum.OndoPriceOracleV2_evt_UnderlyingPriceSetunion allselect block_time as evt_block_time, 0x1dd7950c266fb1be96180a8fdb0591f70200e018 as flux_token_address, bytearray_to_uint256(bytearray_substring(data, 32+1,32)) as newPricefrom ethereum.logswhere contract_address = 0xc53e6824480d976180A65415c19A6931D17265BAand topic0 = 0x1ad78d5a9c05e5f0ee9ff6e3817cc97a99b504483f99ebc08d431bd5c707c741union allselect block_time as evt_block_time,0x1dd7950c266fb1be96180a8fdb0591f70200e018 as flux_token_address,bytearray_to_uint256(bytearray_substring(data, 32*3+1,32)) as newPricefrom ethereum.logswhere contract_address = 0x0502c5ae08E7CD64fe1AEDA7D6e229413eCC6abeand topic0 = 0x3cc2938e8035ab592372e28987d89549a1f8bb703601bc3dbd894f18f5c20a06),contracts as (select flux_token_address, date_trunc('day', min(evt_block_time)) as starting_periodfrom oraclesgroup by 1),fusion as (select date_trunc('day', evt_block_time) as period, evt_block_time, flux_token_address, newPrice as pricefrom oraclesunion allselect period, null as evt_block_time, flux_token_address, null as pricefrom contractscross join unnest(sequence(cast(starting_period as date), current_date, interval '1' day)) as t(period)),ranks as (select period, flux_token_address,last_value(price) ignore nulls over (partition by flux_token_address order by period, evt_block_time desc) as price,row_number() over (partition by period, flux_token_address order by evt_block_time desc) as rkfrom fusion)select period, contract_address, symbol, cast(price as double)/power(10,18) as pricefrom ranks pleft join query_3905503 using (flux_token_address)where rk = 1and contract_address is not nullorder by period desc