Query editor
-- Briber ROI house-vs-external: protocol-sourced (Aerodrome/Velodrome entities + the Team-funded incentivizer) vs external buyers. Reads the materialized engine.WITH base AS (SELECT entity, e, epoch_label, bribe_usd FROM dune.hollywood41x.result_briber_roi),cls AS (SELECT e, epoch_label,sum(CASE WHEN entity LIKE '%Aerodrome%' OR entity LIKE '%Velodrome%' OR entity LIKE '%Team-funded%' THEN bribe_usd ELSE 0 END) house_usd,sum(CASE WHEN entity LIKE '%Aerodrome%' OR entity LIKE '%Velodrome%' OR entity LIKE '%Team-funded%' THEN 0 ELSE bribe_usd END) external_usd,sum(bribe_usd) totalFROM base GROUP BY e, epoch_label)SELECT e, epoch_label, house_usd, external_usd, 100.0*house_usd/NULLIF(total,0) house_share_pctFROM cls WHERE e>=120 ORDER BY e