Query editor
with reward_data as (select time, reward_amount as rewardsfrom (select date_trunc('day', call_block_time) as time, cast(rewards[1] as double)/1e9 as reward_amountfrom ankr_gnosis.ValidatorManager_call_publishPendingRewardswhere call_success = Trueand providers[1] = 0x4069d8a3de3a72eca86ca5e0a4b94619085e7362/*union allselect time, nullfrom unnest(sequence(cast('2022-09-08' as timestamp), cast(now() as timestamp), interval '1' day)) as tbl(time) */) xgroup by time, reward_amountorder by time desc),tvl_data as (select time, gnosis_stakedfrom query_1354477 -- https://dune.com/queries/1354477),summary as (select time, avg((((rewards*0.9)/gnosis_staked)*365)) as apyfrom reward_dataleft join tvl_data using(time)group by 1)select *from summaryorder by time desc--(reward2 - reward1) * 0.9 * ( (timestamp1 - timestamp2) * кол-во сек в году) / staked * 100