Query editor
withveBAL as (selectdate_trunc('day',call_block_time) as day,output_0/1e18 as total_veBAL_supplyfrombalancer_ethereum.veBAL_call_totalSupply--order by date_trunc('day',call_block_time) desc),price AS (SELECT AVG(price) AS price,contract_address AS tokenAddress,date_trunc('week', minute) AS weekFROM prices.usdWHERE contract_address = 0xba100000625a3754423978a60c9317c58a424e3dAND minute > cast('2022-05-01 00:00' as timestamp)GROUP BY date_trunc('week', minute), contract_address),dolper AS (SELECTdate_trunc('week' , v.day) as week ,avg(p.price * 122000 / v.total_veBAL_supply) AS emmission_per_veBALFROMveBAL vleft join price p on v.day = p.weekgroup by 1order by date_trunc('week' , v.day) desc-- group by 1, 2),locked1 as (select week,sum(amount) over (order by week rows between unbounded preceding and current row) as total_vlAurafrom (selectdate_trunc('week',evt_block_time) as week,sum(_lockedAmount/1e18) as amountfrom aura_finance_ethereum.AuraLocker_evt_Stakedgroup by 1union allselectdate_trunc('week',evt_block_time) as week,- sum(_amount/1e18) as amountfrom aura_finance_ethereum.AuraLocker_evt_Withdrawngroup by 1)),locked as(selectweek,avg(total_vlAura)as vlAura_sup_finalfrom locked1group by 1),temp AS (