Query editor
withmellow_vaults as (select distinct vault, vault_name, 'mellow' as protocolfrom dune.maybeyonas.result_mellow_vaults),other_vaults as (select vault, vault_name,protocolfrom query_3896330),actions as (select * from query_3818541),agg as (selectsymbol,underlying_token,staker,sum(case actionwhen 'deposit' then (shares/pow(10, decimals))else -(shares/pow(10, decimals))end) as sharesfrom actions agroup by 1,2,3),latest_prices as (select * from (-- daily pricesselect *,rank() over(partition by token order by date desc) as rank_latestfrom query_3697486) where rank_latest = 1),token_agg as (selecta.symbol,a.underlying_token,a.staker,a.shares as tokens,a.shares*p.price/w.price as eth,a.shares*p.price as usd-- case-- when underlying_token = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 then 1-- else rank()from agg aleft join latest_prices pon p.token = a.underlying_tokenleft join latest_prices won w.token = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2),all_positions AS (select coalesce(protocol, 'non-LRT') as protocol, coalesce(vault_name, cast(staker as varchar)) as staker, token_agg.symbol, tokens, eth, usd, token_agg.underlying_tokenfrom token_aggleft join (select * from other_vaultsunion all