Query editor
-- share price and apr for yearn v3 usdc vault 0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204-- select * from yearn_v3_vault_ethereum.yearn_v302_vault_evt_debtupdated where contract_address = 0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204-- select * from yearn_v3_vault_ethereum.yearn_v302_vault_evt_strategyreported where contract_address = 0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204withshares_supply as (-- get vault token supply for tvl calculationselectblock_date,daily_changes,contract_address,sum(daily_changes) over (order by block_date asc) total_sharesfrom (selectblock_date,contract_address,sum(case when "to" = 0x0000000000000000000000000000000000000000 then amount*-1when "from" = 0x0000000000000000000000000000000000000000 then amount end)as daily_changesfromtokens_ethereum.transferswhere("to" = 0x0000000000000000000000000000000000000000 or "from" = 0x0000000000000000000000000000000000000000)and contract_address = 0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204group by block_date, contract_address)group byblock_date,daily_changes,contract_address),vault_evt as (-- get vault deposit withdraw eventsselectevt_block_time,evt_block_date,evt_index,assets,sharesfromyearn_v3_vault_ethereum.yearn_v302_vault_evt_depositwherecontract_address = 0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204union allselectevt_block_time,evt_block_date,evt_index,assets,sharesfromyearn_v3_vault_ethereum.yearn_v302_vault_evt_withdrawwherecontract_address = 0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204),vault_details as (-- calculating share price and aprselect