Query editor
-- THE BOOK · NEW POOL RADAR · activity before assumptions-- Mode: materialized. Generated locally; execution on Dune requires credits.WITH births AS (SELECT * FROM dune.idonotsayblahblahblah.result_the_book_births),swaps AS (SELECT * FROM dune.idonotsayblahblahblah.result_the_book_swaps),liquidity AS (SELECT CAST(NULL AS varchar) AS pool, CAST(NULL AS varchar) AS action, CAST(NULL AS timestamp) AS block_time, CAST(NULL AS timestamp) AS materialized_at, CAST(NULL AS decimal(38,0)) AS amount_x_raw, CAST(NULL AS decimal(38,0)) AS amount_y_raw WHERE false),volume AS (SELECT * FROM dune.idonotsayblahblahblah.result_the_book_volume),panel AS (WITH trade_marks AS (SELECT pool, sum(pool_hop_volume_usd) AS priced_volume_usd, sum(hop_count) AS hop_count,sum(unpriced_hops) AS unpriced_hops, max(source_latest_event_at) AS latest_trade_at FROM volume GROUP BY pool), swap_marks AS (SELECT pool, sum(exchange_count) AS decoded_exchanges, max(max_bins_crossed) AS max_bins_crossed,max(source_latest_event_at) AS latest_swap_at FROM swaps GROUP BY pool), lp_marks AS (SELECT pool, min(CASE WHEN action = 'ADD' AND (amount_x_raw > 0 OR amount_y_raw > 0)THEN block_time END) AS first_observed_add_at,count_if(action = 'ADD') AS add_events, count_if(action = 'REMOVE') AS remove_eventsFROM liquidity GROUP BY pool)SELECT b.pool, b.focus_mint, b.quote_scope, b.birth_time, b.bin_step_bps,t.priced_volume_usd, t.hop_count, t.unpriced_hops, s.decoded_exchanges,s.max_bins_crossed, l.first_observed_add_at, l.add_events, l.remove_events,CASE WHEN l.first_observed_add_at IS NULL THEN 'Liquidity scan paused at credit cap; no liquidity conclusion is available'WHEN s.latest_swap_at IS NULL THEN 'Add observed; no decoded swap observed in this window'ELSE 'Trading observed; inspect fee token, bin range and exits' END AS next_check,concat('https://app.meteora.ag/dlmm/', b.pool) AS pool_url,concat('https://solscan.io/tx/', b.birth_tx) AS birth_receipt,b.materialized_at AS births_materialized_atFROM births b LEFT JOIN trade_marks t ON b.pool = t.poolLEFT JOIN swap_marks s ON b.pool = s.pool LEFT JOIN lp_marks l ON b.pool = l.poolWHERE b.birth_time >= CAST(current_timestamp AS timestamp) - INTERVAL '24' HOURORDER BY b.birth_time DESC LIMIT 100)SELECT * FROM panel;