Query editor
-- Smart Money Flow Indicator-- Отслеживает поведение early adopters и крупных игроковWITH early_adopters AS (-- Адреса, активные в первые 30 дней BaseSELECT DISTINCT "from" as addressFROM base.transactionsWHERE block_time BETWEEN DATE '2023-07-13' AND DATE '2023-08-13'GROUP BY 1HAVING COUNT(*) >= 5),whale_addresses AS (-- Адреса с крупными транзакциямиSELECT DISTINCT "from" as addressFROM base.transactionsWHERE CAST(value AS DOUBLE) / 1e18 >= 50AND block_time >= NOW() - INTERVAL '90' DAY),smart_money AS (SELECT address FROM early_adoptersUNIONSELECT address FROM whale_addresses),daily_flows AS (SELECTdate_trunc('day', t.block_time) as day,-- Smart money metricsSUM(CASE WHEN sm.address IS NOT NULL THEN CAST(t.value AS DOUBLE) / 1e18 ELSE 0 END) as smart_money_volume,COUNT(CASE WHEN sm.address IS NOT NULL THEN 1 END) as smart_money_tx,COUNT(DISTINCT CASE WHEN sm.address IS NOT NULL THEN t."from" END) as active_smart_wallets,-- Total metricsSUM(CAST(t.value AS DOUBLE) / 1e18) as total_volume,COUNT(*) as total_txFROM base.transactions tLEFT JOIN smart_money sm ON t."from" = sm.addressWHERE t.block_time >= NOW() - INTERVAL '30' DAYGROUP BY 1)SELECTday,active_smart_wallets,smart_money_tx,ROUND(smart_money_volume, 2) as smart_money_volume_eth,ROUND(total_volume, 2) as total_volume_eth,ROUND(smart_money_volume * 100 / NULLIF(total_volume, 0), 2) as smart_money_dominance_pct,ROUND(smart_money_tx * 100.0 / NULLIF(total_tx, 0), 2) as smart_money_tx_share_pct,-- Flow direction indicatorCASEWHEN smart_money_volume > LAG(smart_money_volume, 1) OVER (ORDER BY day) * 1.2 THEN '🟢 Accumulating'WHEN smart_money_volume < LAG(smart_money_volume, 1) OVER (ORDER BY day) * 0.8 THEN '🔴 Distributing'ELSE '🟡 Neutral'END as flow_signalFROM daily_flowsORDER BY day DESC