Query editor
withactions as (select * from query_4008598where babylon_acceptance = 'accepted'-- select * from query_4402472-- where babylon_status = 'staked'),agg as (select0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 as underlying_token,a.finality_provider_name,sum(value) as sharesfrom actions agroup by 1,2),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 (selectp.symbol,a.underlying_token,a.finality_provider_name,a.shares as tokens,a.shares*p.price/w.price as eth,a.shares*p.price as usd-- case-- when underlying_token = 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 then 1-- else rank()from agg aleft join latest_prices pon p.token = a.underlying_tokenleft join latest_prices won w.token = 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599),operator_ranked as (selectrank() over(order by usd desc) as user_rank,*from (selectfinality_provider_name,sum(usd) as usd,sum(eth) as eth_vfrom token_agggroup by 1))select-- coalesce(ov.vault_name, m.vault_name, cast(finality_provider_name as varchar)) as finality_provider_name_name,o.*,casewhen user_rank <= 10