Query editor
-- @title Steakhouse High Yield USDC (Base) — 7d net APY, last 3 months-- @description Daily 7-day trailing net APY for Steakhouse High Yield USDC on Base: V1.1 (0xbeefa7b8…878f, the-- vault that supplies the Coinbase tokenized-stock USDC markets directly) and V2 (0xbeeff7ae…8100, which holds-- V1.1 through a MorphoVaultV1 adapter and is the user-facing product).-- @author Romana (Steakhouse Financial)-- @notes Share price = assets/shares from the vault's own Deposit/Withdraw events (net of fee dilution), last mark-- per day, forward-filled. APY_7d = (p_t / p_{t-7})^(365/7) − 1. Window: last 92 days (7 extra days of history-- pulled so the first plotted day has a full look-back).-- @version 1.0with vaults as (select *from (values(0xbeefa7b88064feef0cee02aaebbd95d30df3878f, 'v1', 'Steakhouse High Yield USDC (V1.1)'), (0xbeeff7ae5e00aae3db302e4b0d8c883810a58100, 'v2', 'Steakhouse High Yield USDC (V2)')) as t(vault_address, version, vault_name)), calendar as (select dayfrom unnest(sequence(current_date - interval '99' day, current_date, interval '1' day)) as t(day)), px_events as (select v.vault_name, e.evt_block_time, cast(e.assets as double) / cast(e.shares as double) as pxfrom metamorpho_vaults_base.metamorphov1_1_evt_deposit einner join vaults v on v.vault_address = e.contract_address and v.version = 'v1'where e.evt_block_time >= current_date - interval '100' day and cast(e.shares as double) > 0union allselect v.vault_name, e.evt_block_time, cast(e.assets as double) / cast(e.shares as double)from metamorpho_vaults_base.metamorphov1_1_evt_withdraw einner join vaults v on v.vault_address = e.contract_address and v.version = 'v1'where e.evt_block_time >= current_date - interval '100' day and cast(e.shares as double) > 0union allselect v.vault_name, e.evt_block_time, cast(e.assets as double) / cast(e.shares as double)from morpho_v2_base.vaultv2_evt_deposit einner join vaults v on v.vault_address = e.contract_address and v.version = 'v2'where e.evt_block_time >= current_date - interval '100' day and cast(e.shares as double) > 0union allselect v.vault_name, e.evt_block_time, cast(e.assets as double) / cast(e.shares as double)from morpho_v2_base.vaultv2_evt_withdraw einner join vaults v on v.vault_address = e.contract_address and v.version = 'v2'where e.evt_block_time >= current_date - interval '100' day and cast(e.shares as double) > 0), px_daily as (select vault_name, cast(date_trunc('day', evt_block_time) as date) as day, max_by(px, evt_block_time) as pxfrom px_eventsgroup by 1, 2), filled as (select c.day, v.vault_name, last_value(p.px) ignore nulls over (partition by v.vault_name order by c.day rows between unbounded preceding and current row) as pxfrom calendar ccross join vaults vleft join px_daily p on p.vault_name = v.vault_name and p.day = c.day), lagged as (