Query editor
/* AMM Liquidity Snapshot: TVL and depth-to-impact per pair (Ethereum) */ /* Adapt pair token addresses & chain if needed */with pair_liquidity as (selecttoken_pair as pair, /* changed from pair to token_pair */ project as dex_name, /* assume dex_name should be sourced from project column */ SUM(amount_usd) as tvl_usd, /* changed from liquidity_usd to amount_usd */ AVG(0) as avg_spread_bps, /* Placeholder as spread_bps column does not exist */ COUNT(distinct tx_from) as num_lps /* changed from liquidity_provider to tx_from */from dex.trades /* changed from dex.pairs to dex.trades */where blockchain = 'ethereum' /* changed from chain to blockchain */group bytoken_pair, project /* changed from dex_name to project */), recent_price_impact as (selectt.token_pair as pair, /* changed from t.pair to t.token_pair */ '' as dex_name, /* replaced t.dex_name with an empty string */ APPROX_PERCENTILE(0, 0.50) as median_price_impact, /* Placeholder as price_impact_pct does not exist */ MAX(0) FILTER(where amount_usd >= 10000) as max_price_impact_10k_usd /* Placeholder as price_impact_pct does not exist */from dex.trades as twhere t.blockchain = 'ethereum' /* changed from t.chain to t.blockchain */and t.block_time >= CURRENT_DATE - INTERVAL '7' daygroup byt.token_pair /* changed from t.pair to t.token_pair */)selectp.pair, p.dex_name, p.tvl_usd, p.avg_spread_bps, p.num_lps, r.median_price_impact, r.max_price_impact_10k_usdfrom pair_liquidity as pleft join recent_price_impact as r on p.pair = r.pair /* changed from USING (pair, dex_name) to ON p.pair = r.pair */order byp.tvl_usd desc /* added p alias to tvl_usd */limit 200