Query editor
selectSUM(amt * price) as flashloan, main.tokenfrom (selectSUM("_amount" / CAST(POWER(10, decimals) as DOUBLE)) as amt, t.symbol as token, DATE(evt_block_time) as dtfrom aave_ethereum.LendingPool_evt_FlashLoan as flashloansleft join tokens.erc20 as t on flashloans."_reserve" = t.contract_addresswhere t.blockchain = 'ethereum'and evt_block_time > CURRENT_TIMESTAMP - INTERVAL '24' hourgroup by2, 3) as mainleft join (selectAVG(price) as price, DATE(MINUTE) as dt, symbolfrom prices.usdwhere blockchain = 'ethereum'and blockchain = 'ethereum'and symbol <> 'ETH'group by2, 3unionselectAVG(price) as price, DATE(MINUTE) as dt, symbolfrom prices.usdwhere blockchain = 'ethereum'and blockchain = 'ethereum'and symbol = 'ETH'group by2, 3) as p on main.token = p.symboland p.dt = main.dtgroup by2