Query editor
-- with eth_staked as (select-- DATE(block_time) as Date,-- sum(amount_staked) as ETH_staked-- from staking_ethereum.deposits-- where depositor_entity = 'RocketPool (Minipool)'-- GROUP by DATE(block_time)-- order by 1 desc-- ),with stakes as (select time, eth_staked as ETH_staked from query_2396713),apr_ratio as (with token_reth as (select date_trunc('day', call_block_time) as time, sum(_ethAmount) as eth, sum(output_0) as rethfrom rocketpool_ethereum.RocketTokenRETH_call_getRethValueGROUP by date_trunc('day', call_block_time)),ratios as (SELECT *,(reth * 1e18)/(eth*1e18) as ratio1from token_rethorder by time desc),token_ratio as (select *,lag(ratio1,1) over (order by time asc) as ratio2from ratios)select time, ((ratio2-ratio1)*(31536000/86400))*100 as aprfrom token_ratioorder by token_ratio.time desc)select apr_ratio.time, apr_ratio.apr, stakes.ETH_stakedfrom apr_ratio join stakeson apr_ratio.time = stakes.timewhere apr_ratio.time > TIMESTAMP '2023-01-06'