Query editor
WITH getLatestPrice as (SELECT price FROM prices.usdWHERE blockchain = 'arbitrum'and symbol = 'WETH'and minute = TIMESTAMP '2023-09-12 05:27:00'limit 1),getAllReturnedFunds as (SELECT SUM(amount_returned_usd) as total_returned_usd FROM query_3023649)SELECT *,total_usdc_to_return + (total_eth_to_return * price) as total_to_return_usd,total_returned_usd / (total_usdc_to_return + (total_eth_to_return * price)) * 100 as return_percFROM (SELECT SUM(usdc_to_return) as total_usdc_to_return,SUM(eth_to_return) as total_eth_to_return,SUM(total_whitehat_bounty_usd) as all_whitehat_bounty_usdFROM query_3021825) xJOIN getLatestPrice ON 1=1JOIN getAllReturnedFunds ON 1=1