Query editor
with v as (select * from query_9191012),p as (select blockchain, pool, arbitrary(asset_class) as asset_class, arbitrary(curator) as curator,bool_or(ext_stop_loss) as sl, bool_or(ext_velocity_guard) as vg,bool_or(ext_swap_allowlist) as sal, bool_or(ext_deposit_allowlist) as dal,max(n_extensions) as n_ext, max(admin_spread_fee_e6) as admin_fee_e6,sum(tvl_usd_avg) as tds,coalesce(sum(tvl_usd) filter (where day = date '2026-11-23'), 0) as tvl_now,sum(vol_usd) as vol, sum(fee_lp_usd) as fee_lp, sum(fee_platform_usd) as fee_plat,sum(vol_usd) filter (where asset_class = 'Stable-stable') as stable_vol,sum(mk_vol) as mk_vol, sum(pnl_10) as pnl_10, sum(mk_fee_platform) as mk_fee_plat,max(pool_mk_coverage) as covfrom vgroup by 1, 2),x as (select p.*,n_ext - (case when sl then 1 else 0 end + case when vg then 1 else 0 end + case when sal then 1 else 0 end + case when dal then 1 else 0 end) as n_otherfrom p),g as (select s.setting, s.val, x.*from xcross join unnest(array[row('0. All pools', 'all'),row('1. Stop-loss extension', case when sl then 'yes' else 'no' end),row('2. Velocity guard', case when vg then 'yes' else 'no' end),row('3. Stop-loss and velocity guard', case when sl and vg then 'a) both' when sl then 'b) stop-loss only' when vg then 'c) velocity guard only' else 'd) neither' end),row('4. Swap allowlist', case when sal then 'yes' else 'no' end),row('5. Deposit allowlist', case when dal then 'yes' else 'no' end),row('6. Other extension contract (curator-specific)', case when n_other > 0 then 'yes' else 'no' end),row('7. Any extension', case when n_ext > 0 then 'yes' else 'no' end),row('8. Curator fee at creation', case when admin_fee_e6 > 0 then 'above zero' else 'zero' end)]) as s(setting, val)),a as (select setting, val as value,count(*) as pools, count_if(vol >= 1e6) as pools_over_1m_volume, count(distinct curator) as curators,sum(tvl_now) as tvl_now_usd,sum(tds) / 70e0 as avg_tvl_usd, sum(tds) as tds,sum(vol) as vol_usd,1e4 * sum(fee_lp + fee_plat) / nullif(sum(vol), 0) as fee_bps,sum(fee_plat) / nullif(sum(fee_lp + fee_plat), 0) as platform_share,coalesce(sum(stable_vol), 0) / nullif(sum(vol), 0) as stable_share,sum(vol) / nullif(sum(tds), 0) as daily_turnover,sum(mk_vol) as scored_vol_usd,1e4 * sum(pnl_10) / nullif(sum(mk_vol), 0) as mk10_bps,sum(pnl_10) as pnl10_usd,sum(pnl_10 - mk_fee_plat) as lp_only_pnl10_usd,1e4 * sum(pnl_10 - mk_fee_plat) / nullif(sum(mk_vol), 0) as lp_only_mk10_bps,365e0 * sum(pnl_10) filter (where cov >= 0.5) / nullif(sum(tds) filter (where cov >= 0.5), 0) as mk10_return_on_tvl_ann,365e0 * sum(pnl_10 - mk_fee_plat) filter (where cov >= 0.5) / nullif(sum(tds) filter (where cov >= 0.5), 0) as lp_only_return_on_tvl_ann,sum(tds) filter (where cov >= 0.5) / 70e0 as avg_tvl_scored_pools_usdfrom ggroup by 1, 2)select setting, value, setting || ': ' || value as setting_value,pools, pools_over_1m_volume, curators,