Query editor
with v as (select *,case when day <= date '2026-11-03' then 'a' else 'b' end as periodfrom query_9191012where pool_mk_coverage >= 0.5),g as (selectcase asset_class when 'Majors (ETH/BTC/BNB)' then '1 Majors' when 'Stable-stable' then '2 Stables' when 'Tokenized stocks & RWA' then '3 Stocks' else '4 Other' end|| ' | ' ||case when ext_stop_loss and ext_velocity_guard then 'a) both'when ext_stop_loss then 'b) stop-loss only'when ext_velocity_guard then 'c) velocity guard only'else 'd) neither' end as grp,case asset_class when 'Majors (ETH/BTC/BNB)' then 'Majors' when 'Stable-stable' then 'Stables' when 'Tokenized stocks & RWA' then 'Stocks' else 'Other' end|| ': ' ||case when ext_stop_loss and ext_velocity_guard then 'both'when ext_stop_loss then 'stop-loss only'when ext_velocity_guard then 'velocity guard only'else 'neither' end as chart_label,count(distinct pool) as pools, count(distinct curator) as curators,sum(tvl_usd_avg) / 70e0 as avg_tvl_usd,sum(vol_usd) as vol_usd,sum(mk_vol) as scored_vol, sum(mk_vol) filter (where period = 'a') as scored_vol_a, sum(mk_vol) filter (where period = 'b') as scored_vol_b,sum(fee_lp_usd + fee_platform_usd) as fees, sum(fee_lp_usd + fee_platform_usd) filter (where period = 'a') as fees_a, sum(fee_lp_usd + fee_platform_usd) filter (where period = 'b') as fees_b,sum(vol_usd) filter (where period = 'a') as vol_a, sum(vol_usd) filter (where period = 'b') as vol_b,sum(pnl_10) as pnl, sum(pnl_10) filter (where period = 'a') as pnl_a, sum(pnl_10) filter (where period = 'b') as pnl_b,sum(pnl_10 - mk_fee_platform) as lpo, sum(pnl_10 - mk_fee_platform) filter (where period = 'a') as lpo_a, sum(pnl_10 - mk_fee_platform) filter (where period = 'b') as lpo_b,sum(tvl_usd_avg) as tds, sum(tvl_usd_avg) filter (where period = 'a') as tds_a, sum(tvl_usd_avg) filter (where period = 'b') as tds_bfrom vgroup by 1, 2)select grp as "group", chart_label, pools, curators, avg_tvl_usd, vol_usd,scored_vol as scored_vol_usd,1e4 * fees / nullif(vol_usd, 0) as fee_bps,1e4 * pnl / nullif(scored_vol, 0) as mk10_bps,1e4 * lpo / nullif(scored_vol, 0) as lp_only_mk10_bps,pnl as pnl10_usd, lpo as lp_only_pnl10_usd,365e0 * lpo / nullif(tds, 0) as lp_only_return_on_tvl_ann,-- before the sell-off: 15 Sep to 3 Nov (50 days)scored_vol_a as scored_vol_before_usd,1e4 * fees_a / nullif(vol_a, 0) as fee_bps_before,1e4 * pnl_a / nullif(scored_vol_a, 0) as mk10_bps_before,1e4 * lpo_a / nullif(scored_vol_a, 0) as lp_only_mk10_bps_before,lpo_a as lp_only_pnl10_before_usd,365e0 * lpo_a / nullif(tds_a, 0) as lp_only_return_on_tvl_ann_before,-- sell-off: 4 to 23 Nov (20 days)scored_vol_b as scored_vol_selloff_usd,1e4 * fees_b / nullif(vol_b, 0) as fee_bps_selloff,1e4 * pnl_b / nullif(scored_vol_b, 0) as mk10_bps_selloff,1e4 * lpo_b / nullif(scored_vol_b, 0) as lp_only_mk10_bps_selloff,lpo_b as lp_only_pnl10_selloff_usd,365e0 * lpo_b / nullif(tds_b, 0) as lp_only_return_on_tvl_ann_selloff,trim(case when scored_vol < 5e6 then 'Scored volume under $5M: not shown in charts. ' when scored_vol < 5e7 then 'Scored volume under $50M: too small to conclude. ' else '' end ||case when avg_tvl_usd < 1e5 then 'Avg TVL under $100k: return on TVL not meaningful. ' else '' end ||case when curators <= 2 then 'One or two curators only. ' else '' end) as note,case when scored_vol >= 5e6 then 1e4 * fees / nullif(vol_usd, 0) end as fee_bps_chart,case when scored_vol >= 5e6 then 1e4 * pnl / nullif(scored_vol, 0) end as mk10_bps_chart,