Fundamental Analysis Agent
The Fundamental Analysis Agent is a specialized module designed to evaluate the intrinsic value and long-term health of crypto assets, specifically Bitcoin. Unlike the Technical Agent which focuses on price action, this agent assesses "on-chain" health, institutional adoption trends, and macro market cycles to provide a valuation-based recommendation.
Overview
The Fundamental Analysis Agent operates by synthesizing real-time news data with institutional knowledge stored in the system's RAG (Retrieval-Augmented Generation) vector store. It determines whether an asset is currently in an accumulation or distribution phase and assesses the strength of the underlying network.
Key Analysis Metrics
- Valuation Status: Determines if the asset is
UNDERVALUED,FAIRLY_VALUED, orOVERVALUED. - Market Cycle Phase: Identifies the current stage of the market (e.g.,
ACCUMULATION,MARKUP,DISTRIBUTION, orMARKDOWN). - Network Health: A qualitative assessment (
STRONG,MODERATE, orWEAK) based on adoption news and network growth data.
Data Sources & Knowledge Retrieval
The agent leverages two primary channels to form its analysis:
1. Real-time News & RSS
Using the NewsAPIConnector, the agent fetches the latest financial headlines. It prioritizes high-quality crypto-specific sources to gauge institutional sentiment and regulatory shifts.
- Sources: CoinTelegraph, CoinDesk, and Google News RSS.
- Fallback Mechanism: If an API key for NewsAPI is not provided, the connector automatically falls back to curated RSS feeds to ensure uninterrupted analysis.
2. Fundamental Knowledge Base (RAG)
The agent queries a dedicated vector store index (the fundamental domain) populated by the KnowledgeIndexer. This index typically contains:
- Whitepapers and project documentation.
- Historical market cycle analysis.
- Frameworks for valuing decentralized networks (e.g., Metcalfe’s Law applications).
Analysis Schema
The agent returns structured data following the FundamentalAnalysis Pydantic model. This ensures the Trading Orchestrator can programmatically parse its reasoning.
Response Structure
| Field | Type | Description |
| :--- | :--- | :--- |
| recommendation | Literal["BUY", "SELL", "HOLD"] | The core trading action. |
| confidence | int (0-100) | Numerical certainty of the analysis. |
| reasoning | str | Detailed explanation of the fundamental drivers. |
| metadata | FundamentalMetadata | Specific data points regarding valuation and cycles. |
| key_factors | List[str] | Top 5 factors (e.g., "Network Growth," "ETF Inflows"). |
FundamentalMetadata Object
{
"valuation_status": "UNDERVALUED",
"market_cycle_phase": "ACCUMULATION",
"network_health": "STRONG"
}
Usage Example
The Fundamental Agent is typically invoked as part of the TradingOrchestrator analysis flow. Below is an example of the structured output generated by the agent during a market evaluation.
from agents.schemas import FundamentalAnalysis
# Example output from the Agent
analysis = FundamentalAnalysis(
recommendation="BUY",
confidence=85,
reasoning="Network addresses have increased by 15% YoY despite price stagnation. Current MVRV ratios suggest we are in an accumulation phase.",
key_factors=["Address Growth", "Institutional Inflow", "Low Exchange Reserve"],
metadata={
"valuation_status": "UNDERVALUED",
"market_cycle_phase": "ACCUMULATION",
"network_health": "STRONG"
}
)
print(f"Signal: {analysis.recommendation} ({analysis.confidence}%)")
print(f"Cycle: {analysis.metadata.market_cycle_phase}")
Configuration
To maximize the agent's effectiveness:
- News API: Set the
NEWSAPI_KEYin your.envfile for higher-quality global news coverage. - Knowledge Base: Place relevant fundamental research PDFs or Markdown files in
knowledge/fundamental/and run theKnowledgeIndexerto update the vector store. - Model Selection: While it works with local models (Ollama), larger models like
llama-3.3-70bare recommended for nuanced fundamental reasoning.