{"slug": "i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code", "title": "I built a multi-agent BTC research pipeline — 3 agents, 1 daily signal, full code", "summary": "A developer built a multi-agent Bitcoin research pipeline that combines technical, on-chain, and macro analysis into a single daily trading signal. The system uses three specialized agents with weighted scores — on-chain (0.40 weight), technical (0.35), and macro (0.25) — to produce a calibrated BUY signal with a 0.662 score and 0.684 confidence, recommending a partial position of 25-50% of capital. The pipeline is designed to resolve conflicting signals, such as when on-chain fundamentals indicate a buying opportunity while technical indicators suggest waiting for confirmation.", "body_md": "BTC at $76,099. Down 40.8% from the $125,835 ATH. RSI neutral at 54. Sitting 8% below the 200-day EMA.\n\nMost retail traders and even most bots handle this kind of sideways chop with rules-based buy-the-dip logic. But rules miss context — when exchange reserves are at 7-year lows and $2.5B in ETF money just flowed in during a correction, that is structurally different from \"BTC dropped 8% in a week, time to buy.\"\n\nSo I built a multi-agent BTC research system that does the reasoning explicitly. Three specialized agents, each with a domain, weighted and fused into a single daily signal.\n\n```\n                        Master Controller (zo.ask)\n                                  │\n              ┌───────────────────┼───────────────────┐\n              ▼                   ▼                   ▼\n     Technical Agent      On-Chain Agent       Macro Agent\n        (0.35)               (0.40)              (0.25)\n              │                   │                   │\n              └───────────────────┼───────────────────┘\n                                  ▼\n                        Signal Generator\n                                  ▼\n                          Daily Report\n```\n\n**Technical Agent** — RSI, MACD, Bollinger Bands, support/resistance, price vs 200 EMA, distance from ATH. Reads the chart and gives a directional score.\n\n**On-Chain Agent** — MVRV, realized price floor, exchange reserves (7-year low = bullish), ETF flows, accumulation trend score. Reads the blockchain fundamentals.\n\n**Macro Agent** — DXY correlation, BTC-S&P500 correlation, Fed rate expectations, S&P500 at record highs (risk-on backdrop), geopolitical risk (Iran war premium), institutional adoption. Reads the world outside crypto.\n\nEach agent outputs a `score`\n\n(0-1) and a `confidence`\n\n(0-1). The signal generator multiplies scores by weights (0.35 / 0.40 / 0.25) and sums them. Today's output:\n\n```\nTotal Score:    0.662\nConfidence:     0.684\nSignal Type:    BUY\nAction:         Take partial position (25-50% of capital)\n```\n\nHere is the on-chain scoring (simplified):\n\n``` python\ndef score_mvrv(mvrv):\n    if mvrv < 1.5:   return +0.20, \"UNDERVALUED\"\n    if mvrv < 2.5:   return +0.10, \"FAIR_VALUE\"\n    if mvrv < 3.5:   return -0.15, \"OVERVALUED\"\n    return                 -0.25, \"EXTREME_OVERVALUED\"\n\ndef score_exchange_reserves(pct):\n    if pct < 12:    return +0.15, \"LOW_RESERVES_BULLISH\"  # 7-year low\n    if pct < 15:    return +0.05, \"NORMAL\"\n    return                 -0.10, \"HIGH_RESERVES_BEARISH\"\n```\n\nThe technical agent is similar — RSI 54 = neutral, below 200 EMA = -0.10, near resistance = -0.15. Each indicator adds or subtracts from the total weight.\n\n| Agent | Score | Weight | Contribution |\n|---|---|---|---|\n| Technical | 0.44 | 0.35 | 0.154 |\n| On-Chain | 0.80 | 0.40 | 0.320 |\n| Macro | 0.75 | 0.25 | 0.188 |\n\nOn-chain at 0.8 because: MVRV 1.5 (fair value but historically a buy zone), realized price floor $50K (we're well above), exchange reserves at 11.9% (7-year low = holders aren't selling), $2.5B in Q1 ETF inflows (institutions bought the correction).\n\nMacro at 0.75 because: S&P500 and Nasdaq at record highs (risk-on backdrop that should lift BTC), BTC lagging those highs (bullish catch-up), MSTR bought 34,164 BTC at $74,395 ($2.54B position), Trump Strategic Bitcoin Reserve at 328,372 BTC (~$24.5B).\n\nTechnical is the laggard at 0.44 because: RSI neutral, below 200 EMA ($82,919), and the price is near the $75,000 resistance. The chart says \"wait for confirmation\" while the fundamentals say \"the dip is over.\"\n\nThat's the whole point of the multi-agent design: when fundamentals say BUY but technicals say WAIT, the system outputs a calibrated partial-position signal instead of a binary yes/no.\n\n```\nSTRONG_BUY:   score >= 0.75 → full position (50-100%)\nBUY:          score >= 0.60 → partial position (25-50%)\nNEUTRAL:      score >= 0.45 → hold / no new entries\nSELL:         score >= 0.30 → reduce position 25-50%\nSTRONG_SELL:  score <  0.30 → exit or short\ncd btc-research\npython3 scripts/run_analysis.py\n```\n\nOutputs to `signals/daily_signals.json`\n\nand `reports/daily_report_YYYY-MM-DD.md`\n\n. Each agent is independently runnable:\n\n```\npython3 agents/technical_agent.py   # chart signals\npython3 agents/onchain_agent.py     # Glassnode-style metrics\npython3 agents/macro_agent.py       # DXY, Fed, equities\n```\n\nThe whole thing runs as a scheduled agent on Zo Computer at 06:00 UTC daily, writes a markdown report, and could email/Telegram it to the user. Every component is plain Python — no LLM calls, no external APIs, fully transparent scoring.\n\nThe agents currently use a static dataset (current price, MVRV, ETF flows, etc.) hand-curated from research. The next iteration is to wire real data: CoinGecko or Glassnode for price/on-chain, FRED for macro. The agent code is structured for it — `analyze()`\n\njust needs to swap the hardcoded metrics dict for an API call.\n\nThe signal generator is also naive about disagreement. When technicals say NEUTRAL but on-chain says BULLISH, the weighted sum works but doesn't tell you \"technicals are the drag, watch for the breakout.\" A v2 could add per-agent variance detection and flag low-confidence signals explicitly.\n\n`/home/workspace/btc-research/skills/btc_system/SKILL.md`\n\n`btc-research/AUTOMATION.md`\n\n`signals/daily_signals.json`\n\nMIT license. The signal is research, not advice — always do your own due diligence. Crypto is risky. The point of the system is to make the reasoning auditable, not to replace your judgment.\n\nIf you have ideas for additional agents (sentiment, derivatives funding rates, options skew, miner flows), PRs welcome. The agent interface is simple — return a dict with `signal`\n\n, `score`\n\n, `confidence`\n\n, and a `summary`\n\nstring — and the signal generator picks them up automatically.", "url": "https://wpnews.pro/news/i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code", "canonical_source": "https://dev.to/aman_sachan_126d19c4a2773/i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code-4c7b", "published_at": "2026-06-04 00:51:28+00:00", "updated_at": "2026-06-04 01:12:46.132396+00:00", "lang": "en", "topics": ["ai-agents", "machine-learning", "artificial-intelligence"], "entities": ["BTC", "ETF"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code", "markdown": "https://wpnews.pro/news/i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code.md", "text": "https://wpnews.pro/news/i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code.txt", "jsonld": "https://wpnews.pro/news/i-built-a-multi-agent-btc-research-pipeline-3-agents-1-daily-signal-full-code.jsonld"}}