Changes include: - Updated architecture documentation - Enhanced module definitions (OQI-001 to OQI-008) - ML integration documentation updates - Trading strategies documentation - Orchestration and inventory updates - Docker configuration updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5.7 KiB
5.7 KiB
| id | title | type | status | priority | epic | project | version | created_date | updated_date |
|---|---|---|---|---|---|---|---|---|---|
| ET-PFM-001 | Arquitectura del Dashboard de Portfolio | Technical Specification | Done | Alta | OQI-008 | trading-platform | 1.0.0 | 2025-12-05 | 2026-01-04 |
ET-PFM-001: Arquitectura del Dashboard de Portfolio
Épica: OQI-008 - Portfolio Manager Versión: 1.0 Fecha: 2025-12-05 Estado: Planificado
Arquitectura General
┌─────────────────────────────────────────────────────────────────────────┐
│ PORTFOLIO DASHBOARD │
├─────────────────────────────────────────────────────────────────────────┤
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Summary Card │ │ Positions List │ │ Performance │ │
│ │ Component │ │ Component │ │ Chart Component │ │
│ └────────┬────────┘ └────────┬────────┘ └────────┬────────┘ │
│ └────────────────────┴───────────────────┘ │
│ │ │
│ ┌─────────────────────────────┴─────────────────────────────────────┐ │
│ │ Portfolio Store (Zustand) │ │
│ │ - positions, summary, performance, alerts │ │
│ └─────────────────────────────┬─────────────────────────────────────┘ │
└────────────────────────────────┼────────────────────────────────────────┘
│ API + WebSocket
┌────────────────────────────────┼────────────────────────────────────────┐
│ BACKEND │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ PortfolioService│ │ PositionService │ │ MetricsService │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
│ │ │
│ ┌─────────────────────────────┴─────────────────────────────────────┐ │
│ │ PostgreSQL + Redis │ │
│ └───────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
API Endpoints
| Method | Endpoint | Descripción |
|---|---|---|
| GET | /api/portfolio |
Resumen del portfolio |
| GET | /api/portfolio/positions |
Lista de posiciones |
| GET | /api/portfolio/performance |
Datos de rendimiento |
| GET | /api/portfolio/history |
Historial de valor |
| WS | /portfolio |
Updates en tiempo real |
Modelos de Datos
Portfolio Summary
interface PortfolioSummary {
totalValue: number;
totalCost: number;
totalPnL: number;
totalPnLPercent: number;
dayPnL: number;
dayPnLPercent: number;
cash: number;
investedValue: number;
positionsCount: number;
}
Position
interface Position {
id: string;
symbol: string;
name: string;
quantity: number;
avgCost: number;
currentPrice: number;
marketValue: number;
costBasis: number;
pnl: number;
pnlPercent: number;
dayChange: number;
dayChangePercent: number;
weight: number; // % del portfolio
assetType: 'stock' | 'crypto' | 'etf' | 'bond';
}
WebSocket Events
| Event | Payload | Descripción |
|---|---|---|
portfolio:update |
PortfolioSummary |
Actualización de resumen |
position:update |
Position |
Actualización de posición |
price:update |
{symbol, price} |
Precio actualizado |
Referencias
Especificación técnica - Sistema NEXUS