Query editor
with staking_token(symbol,entity,contract_address,supply) as(values -- depoly date('stETH', 'Lido', 0xae7ab96520de3a18e5e111b5eaab095312d7fe84, 8533185), -- 2020-12-17('wstETH', 'Lido', 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0, 2926496), -- 2021-02-19('rETH', 'Rocket Pool', 0xae78736cd615f374d3085123a210448e74fc6393, 522368), -- 2021-09-30('cbETH', 'Coinbase', 0xbe9895146f7af43049ca1c1ae358b0541ea49704, 1244347), -- 2022-02-03('sfrxETH','Frax Finance', 0xac3e018457b222d93114458476f3e3416abbe38f, 172670), -- 2022-10-06('swETH', 'Swell', 0xf951E335afb289353dc249e82926178EaC7DEd78, 46002) -- 2023-04-12),lsd_token_latest_price_part1 as ( -- stETH & wstETH & rETH & cbETHselectt1.symbol,-- t1.contract_address,t2.price as token_price_usdfrom staking_token t1inner join prices.usd_latest t2 on t1.contract_address = t2.contract_address),lsd_token_dex_latest_price_part2 as ( -- sweth & sfrxETH(select'swETH' as symbol,-- token_address as contract_address,token_price_usdfromdex.prices_latestwheretoken_address = cast(0xf951E335afb289353dc249e82926178EaC7DEd78 as varchar)and token_price_usd <> 0order by block_time desclimit 1)union all(select'sfrxETH' as symbol,-- token_address as contract_address,token_price_usdfromdex.prices_latestwheretoken_address = cast(0xac3e018457b222d93114458476f3e3416abbe38f as varchar) -- sfrxETHand token_price_usd <> 0order by block_time desclimit 1)),lsd_token_price as(select * from lsd_token_latest_price_part1union allselect * from lsd_token_dex_latest_price_part2),total_maket_supply as(select sum(supply) as total_maket from staking_token)selectrank()over(order by t1.supply desc) as ranking,t1.symbol,t1.supply as amount_staked,