Query editor
with staking_balance as (selectsum(casewhen "to" = 0x23ebc3770f98c01edab20eb1ef17ee633c19b467 then amountwhen "from" = 0x23ebc3770f98c01edab20eb1ef17ee633c19b467 then -amountelse 0end) as staked_wccfrom tokens.transferswhere blockchain = 'bnb'and contract_address = 0x6050d829f5a5e0ea758d8357ddcdec1381699248and ("to" = 0x23ebc3770f98c01edab20eb1ef17ee633c19b467or "from" = 0x23ebc3770f98c01edab20eb1ef17ee633c19b467)),latest_price as (select price_usdtfrom (selectblock_time,casewhen token_bought_address = 0x6050d829f5a5e0ea758d8357ddcdec1381699248and token_sold_address = 0x55d398326f99059ff775485246999027b3197955and cast(token_bought_amount as double) > 0then cast(token_sold_amount as double) / cast(token_bought_amount as double)when token_sold_address = 0x6050d829f5a5e0ea758d8357ddcdec1381699248and token_bought_address = 0x55d398326f99059ff775485246999027b3197955and cast(token_sold_amount as double) > 0then cast(token_bought_amount as double) / cast(token_sold_amount as double)else nullend as price_usdtfrom dex.tradeswhere blockchain = 'bnb'and ((token_bought_address = 0x6050d829f5a5e0ea758d8357ddcdec1381699248and token_sold_address = 0x55d398326f99059ff775485246999027b3197955)or (token_sold_address = 0x6050d829f5a5e0ea758d8357ddcdec1381699248and token_bought_address = 0x55d398326f99059ff775485246999027b3197955))) twhere price_usdt is not nulland price_usdt > 0and price_usdt < 1000order by block_time desclimit 1),ea_tvl as (selectstaked_wcc * price_usdt as ea_finance_tvl_usdfrom staking_balancecross join latest_price),wcc_tvl as (select 219037.0 as wcc_tvl_usd)selectround(100 * ea_finance_tvl_usd / nullif(wcc_tvl_usd, 0), 2) as ea_tvl_to_wcc_tvl_pctfrom ea_tvl