Query editor
-- ADA onchain signal for SMT's ONCHAIN persona.-- Signed, price-free, no join, rolling daily.-- Cardano is UTXO-based: accumulating wallets gather many small UTXOs into few-- (inputs per tx rises); distribution fans one UTXO into many payouts (falls).-- NOTE: cardano.transaction.input_count / output_count are NULL in Dune, which-- is why this counts the spends themselves from tx_input instead.WITH daily AS (SELECT DATE(spent_block_time) AS d,COUNT(*) AS utxos_consumed,COUNT(DISTINCT spent_tx_hash) AS spending_txFROM cardano.tx_inputWHERE spent_block_time >= NOW() - INTERVAL '45' DAYGROUP BY 1),ratio AS (SELECT d, utxos_consumed, spending_tx,utxos_consumed / CAST(spending_tx AS DOUBLE) AS inputs_per_txFROM daily)SELECTd,ROUND(inputs_per_tx - AVG(inputs_per_tx) OVER (ORDER BY d ROWS BETWEEN 30 PRECEDING AND 1 PRECEDING), 5)AS net_consolidation_signal,ROUND(inputs_per_tx, 4) AS inputs_per_tx,utxos_consumed,spending_txFROM ratioORDER BY d DESC;