Introduction & Features
Relevant source files
The following files were used as context for generating this wiki page:
The Financial Asset Relationship Database (FarDb) provides a platform for modeling and visualizing complex connections between various financial instruments. It maps dependencies between assets like equities, bonds, commodities, and currencies to help users understand market impacts and regulatory risks. The system processes market data to discover relationships automatically and presents them through an interactive 3D network interface.
Sources: CHANGELOG.md:88-91, ARCHITECTURE.md:143-157
## Core System Architecture
The application uses a multi-layered architecture that separates data modeling, business logic, and user interface components.
### Architecture Layers
- User Interface Layer: Offers a production-ready Next.js frontend and a non-production Gradio demo interface.
- API Layer: A FastAPI backend manages requests for assets, metrics, and visualization data.
- Core Business Logic Layer: The
AssetRelationshipGraphclass manages the network structure and relationship discovery algorithms. - Data Layer: Defines domain models using Python dataclasses and fetches market data via
yfinance.
Sources: ARCHITECTURE.md:14-77, AI_RULES.md:13-23
### Data Flow and Interaction
The system supports two primary interaction flows depending on the environment. The production flow routes requests through the FastAPI layer, while the demo flow uses direct function calls within the Gradio application.
The diagram shows how the UI Layer communicates with Core Business Logic through either an API or direct calls to populate the Data Layer.
Sources: ARCHITECTURE.md:14-77
## Key Features
### Asset Class Support
The system models diverse financial instruments with specific attributes and validation rules.
| Asset Class | Key Attributes | Validation Rules |
|---|---|---|
| Equity | P/E Ratio, Dividend Yield, EPS, Sector | Non-negative price |
| Bond | Yield, Duration, Credit Rating | Yield constraints |
| Commodity | Spot Price, Futures Price | Positive pricing |
| Currency | Exchange Rate | 3-letter ISO code |
| Regulatory Event | Impact Score, Date, Activity Type | Score range (-1 to 1) |
Sources: CHANGELOG.md:104-113, AUDIT_REPORT.md:28-40
### Automated Relationship Discovery
The logic engine identifies links between assets based on industry sectors, corporate structures, and market exposures.
- Sector Affinity: Connects assets belonging to the same industry sector.
- Corporate Links: Maps relationships between a corporation's equity and its issued bonds.
- Commodity Exposure: Links equities to commodities that impact their operational costs or revenues.
- Currency Risk: Maps assets to relevant currency fluctuations.
- Event Impact: Propagates the effects of regulatory events across the network based on impact scores.
Sources: CHANGELOG.md:115-121, AUDIT_REPORT.md:162-171
### Interactive Visualization
The application generates a 3D network graph to represent asset connections visually.
This sequence diagram illustrates the steps taken to fetch and render the 3D network visualization.
Sources: ARCHITECTURE.md:86-103, AI_RULES.md:19-21
## Technology Stack
FarDb utilizes a modern Python-centric stack for its backend and data processing capabilities.
- Python 3.10+: Core programming language.
- Gradio: Used for rapid prototyping and demo interfaces.
- FastAPI: Provides the high-performance REST API for production.
- Pandas/NumPy: Handle data manipulation and numerical computations.
- Plotly: The exclusive library for all interactive charts and 3D network visualizations.
- yfinance: Fetches real-time and historical market data.
- Pydantic: Manages data validation and system settings.
Sources: AI_RULES.md:7-23, ARCHITECTURE.md:111-135, SUMMARY.md:109-114
## Conclusion
The Financial Asset Relationship Database introduces a structured approach to analyzing market interdependencies. By combining automated discovery logic with 3D visualization, it enables developers and analysts to track how changes in one asset or regulatory event ripple through a broader financial ecosystem. Its architecture supports both demo exploration and production-grade API integration.
Sources: ARCHITECTURE.md:7-12, AUDIT_REPORT.md:11-18