- FASE-0: Diagnostic audit of 500+ files, 33 findings cataloged (7P0/8P1/12P2/6P3) - FASE-1: Resolved 7 P0 critical conflicts (ports, paths, dedup OQI-010/ADR-002, orphan schemas) - FASE-2: Resolved 8 P1 issues (traces, README/CLAUDE.md, DEPENDENCY-GRAPH v2.0, DDL drift, stack versions, DoR/DoD) - FASE-3: Resolved 12 P2 issues (archived tasks indexed, RNFs created, OQI-010 US/RF/ET, AGENTS v2.0) - FASE-4: Purged 3 obsolete docs to _archive/, fixed MODELO-NEGOCIO.md broken ref - FASE-5: Cross-layer validation (DDL→OQI 66%, OQI→BE 72%, BE→FE 78%, Inventories 95%) - FASE-6: INFORME-FINAL, SA-INDEX (18 subagents), METADATA COMPLETED 27/33 findings resolved (82%), 6 P3 deferred to backlog. 18 new files created, 40+ modified, 4 archived. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
216 lines
7.4 KiB
Markdown
216 lines
7.4 KiB
Markdown
---
|
|
id: "MAP-OQI-010"
|
|
title: "Mapa de OQI-010-llm-trading-integration"
|
|
type: "Index"
|
|
project: "trading-platform"
|
|
updated_date: "2026-02-06"
|
|
---
|
|
|
|
# _MAP: OQI-010 - LLM Trading Integration
|
|
|
|
**Ultima actualizacion:** 2026-02-06
|
|
**Estado:** Planning
|
|
**Version:** 1.1.0
|
|
|
|
---
|
|
|
|
## Proposito
|
|
|
|
Esta epica implementa la integracion avanzada del LLM con fine-tuning para trading, incluyendo:
|
|
- Fine-tuning con estrategias AMD/ICT/SMC
|
|
- MCP Binance Connector
|
|
- Sistema de gestion de riesgo
|
|
- API de predicciones para frontend
|
|
- Persistencia y tracking de predicciones
|
|
|
|
---
|
|
|
|
## Contenido del Directorio
|
|
|
|
```
|
|
OQI-010-llm-trading-integration/
|
|
├── README.md # Descripcion de la epica
|
|
├── _MAP.md # Indice del modulo (este archivo)
|
|
│
|
|
├── historias-usuario/ # User Stories
|
|
│ ├── US-LTI-001-analizar-mercado-chat.md # [NEW] Analizar mercado via chat
|
|
│ ├── US-LTI-002-ejecutar-trade-chat.md # [NEW] Ejecutar trade via chat
|
|
│ ├── US-LTI-003-interpretar-senales.md # [NEW] Interpretar senales ML
|
|
│ └── US-LTI-004-analisis-portfolio.md # [NEW] Analisis portfolio via chat
|
|
│
|
|
├── requerimientos/ # Requerimientos funcionales
|
|
│ ├── RF-LTI-001-tool-framework.md # [NEW] Framework de tools LLM
|
|
│ ├── RF-LTI-002-prompt-templates.md # [NEW] Templates de prompts
|
|
│ └── RF-LTI-003-safety-guardrails.md # [NEW] Guardrails de seguridad
|
|
│
|
|
├── especificaciones/ # Especificaciones tecnicas
|
|
│ ├── ET-LTI-001-architecture.md # [NEW] Arquitectura integracion
|
|
│ └── ET-LTI-002-database.md # [NEW] Modelo de datos
|
|
│
|
|
└── implementacion/ # Trazabilidad de implementacion (pendiente)
|
|
└── TRACEABILITY.yml
|
|
```
|
|
|
|
> **Nota (2026-02-06):** Los IDs originales planificados (RF-LLM-*, US-LLM-*, ET-LLM-*) pertenecen
|
|
> a la vision original del README y no fueron materializados como archivos individuales.
|
|
> Los nuevos documentos usan el prefijo **LTI** (LLM-Trading Integration) para distinguir
|
|
> la capa de integracion (OQI-010) del agente LLM base (OQI-007).
|
|
|
|
---
|
|
|
|
## Historias de Usuario - Capa de Integracion (LTI)
|
|
|
|
| ID | Historia | SP | Prioridad | Estado |
|
|
|----|----------|-----|-----------|--------|
|
|
| [US-LTI-001](historias-usuario/US-LTI-001-analizar-mercado-chat.md) | Analizar Mercado via Chat | 8 | Alta | Backlog |
|
|
| [US-LTI-002](historias-usuario/US-LTI-002-ejecutar-trade-chat.md) | Ejecutar Trade via Chat | 13 | Alta | Backlog |
|
|
| [US-LTI-003](historias-usuario/US-LTI-003-interpretar-senales.md) | Interpretar Senales ML en Lenguaje Natural | 5 | Media | Backlog |
|
|
| [US-LTI-004](historias-usuario/US-LTI-004-analisis-portfolio.md) | Analisis de Portfolio via Chat | 5 | Media | Backlog |
|
|
|
|
**Total US-LTI:** 31 SP
|
|
|
|
---
|
|
|
|
## Requerimientos Funcionales - Capa de Integracion (LTI)
|
|
|
|
| ID | Requerimiento | Prioridad | Estado |
|
|
|----|---------------|-----------|--------|
|
|
| [RF-LTI-001](requerimientos/RF-LTI-001-tool-framework.md) | Framework de Tools LLM para Trading | Alta | Backlog |
|
|
| [RF-LTI-002](requerimientos/RF-LTI-002-prompt-templates.md) | Templates de Prompts para Trading | Alta | Backlog |
|
|
| [RF-LTI-003](requerimientos/RF-LTI-003-safety-guardrails.md) | Guardrails de Seguridad para Trading via LLM | Critica | Backlog |
|
|
|
|
---
|
|
|
|
## Especificaciones Tecnicas - Capa de Integracion (LTI)
|
|
|
|
| ID | Especificacion | RF Padre | Estado |
|
|
|----|----------------|----------|--------|
|
|
| [ET-LTI-001](especificaciones/ET-LTI-001-architecture.md) | Arquitectura de Integracion LLM-Trading | RF-LTI-001 | Backlog |
|
|
| [ET-LTI-002](especificaciones/ET-LTI-002-database.md) | Modelo de Datos LLM-Trading Integration | RF-LTI-001 | Backlog |
|
|
|
|
---
|
|
|
|
## Requerimientos Funcionales (Vision Original - README)
|
|
|
|
| ID | Nombre | Prioridad | SP | Estado |
|
|
|----|--------|-----------|-----|--------|
|
|
| RF-LLM-001 | Fine-tuning con estrategias | P0 | 13 | Pendiente |
|
|
| RF-LLM-002 | MCP Binance Connector | P0 | 8 | Pendiente |
|
|
| RF-LLM-003 | Sistema gestion de riesgo | P0 | 8 | Pendiente |
|
|
| RF-LLM-004 | API predicciones frontend | P0 | 5 | Pendiente |
|
|
| RF-LLM-005 | Persistencia predicciones | P1 | 5 | Pendiente |
|
|
| RF-LLM-006 | Analisis confluencia ML | P0 | 5 | Pendiente |
|
|
| RF-LLM-007 | WebSocket real-time | P1 | 5 | Pendiente |
|
|
| RF-LLM-008 | Tracking outcomes | P1 | 5 | Pendiente |
|
|
| RF-LLM-009 | Dashboard accuracy | P2 | 3 | Pendiente |
|
|
| RF-LLM-010 | Circuit breaker auto | P0 | 5 | Pendiente |
|
|
|
|
**Total:** 62 SP
|
|
|
|
---
|
|
|
|
## Historias de Usuario por Sprint (Vision Original - README)
|
|
|
|
### Sprint 1: Infraestructura (21 SP)
|
|
|
|
| ID | Historia | SP | Estado |
|
|
|----|----------|-----|--------|
|
|
| US-LLM-001 | MCP Binance Connector | 8 | Pendiente |
|
|
| US-LLM-002 | Pipeline fine-tuning | 8 | Pendiente |
|
|
| US-LLM-003 | DDL PostgreSQL | 5 | Pendiente |
|
|
|
|
### Sprint 2: Core Features (26 SP)
|
|
|
|
| ID | Historia | SP | Estado |
|
|
|----|----------|-----|--------|
|
|
| US-LLM-004 | Analisis ML + explicacion | 8 | Pendiente |
|
|
| US-LLM-005 | Validacion de riesgo | 5 | Pendiente |
|
|
| US-LLM-006 | API predicciones | 5 | Pendiente |
|
|
| US-LLM-007 | WebSocket predicciones | 5 | Pendiente |
|
|
| US-LLM-008 | Calculo confluencia | 3 | Pendiente |
|
|
|
|
### Sprint 3: Integracion (21 SP)
|
|
|
|
| ID | Historia | SP | Estado |
|
|
|----|----------|-----|--------|
|
|
| US-LLM-009 | Ejecucion MT4/Binance | 8 | Pendiente |
|
|
| US-LLM-010 | Tracking outcomes | 5 | Pendiente |
|
|
| US-LLM-011 | Metricas accuracy | 5 | Pendiente |
|
|
| US-LLM-012 | Circuit breaker | 3 | Pendiente |
|
|
|
|
### Sprint 4: Optimizacion (21 SP)
|
|
|
|
| ID | Historia | SP | Estado |
|
|
|----|----------|-----|--------|
|
|
| US-LLM-013 | Fine-tuning produccion | 8 | Pendiente |
|
|
| US-LLM-014 | Alertas oportunidades | 5 | Pendiente |
|
|
| US-LLM-015 | Dashboard monitoreo | 5 | Pendiente |
|
|
| US-LLM-016 | Tests integracion | 3 | Pendiente |
|
|
|
|
**Total:** 89 SP
|
|
|
|
---
|
|
|
|
## Componentes Nuevos
|
|
|
|
### 1. MCP Binance Connector
|
|
- **Ubicacion:** `apps/mcp-binance-connector/`
|
|
- **Puerto:** 3606
|
|
- **Tecnologia:** Node.js + TypeScript + CCXT
|
|
- **Documentacion:** `docs/01-arquitectura/MCP-BINANCE-CONNECTOR-SPEC.md`
|
|
|
|
### 2. Risk Management Service
|
|
- **Ubicacion:** `apps/llm-agent/src/services/risk_manager.py`
|
|
- **Funcionalidades:** Position sizing, drawdown monitor, circuit breaker
|
|
|
|
### 3. Predictions API
|
|
- **Ubicacion:** `apps/llm-agent/src/api/predictions.py`
|
|
- **Endpoints:** REST + WebSocket
|
|
- **Puerto:** 3085
|
|
|
|
### 4. Fine-Tuning Pipeline
|
|
- **Ubicacion:** `apps/llm-agent/fine_tuning/`
|
|
- **Dataset:** JSONL con estrategias de trading
|
|
- **Modelo:** LoRA adapter para Llama 3 8B
|
|
|
|
---
|
|
|
|
## DDL Nuevas Tablas
|
|
|
|
```sql
|
|
-- Schema: ml
|
|
CREATE TABLE ml.llm_predictions (...)
|
|
CREATE TABLE ml.prediction_outcomes (...)
|
|
CREATE TABLE ml.llm_decisions (...)
|
|
CREATE TABLE ml.risk_events (...)
|
|
```
|
|
|
|
Ver detalle en: `docs/01-arquitectura/INTEGRACION-LLM-FINE-TUNING.md`
|
|
|
|
---
|
|
|
|
## Dependencias
|
|
|
|
### Depende de:
|
|
- OQI-001: Autenticacion (Completado)
|
|
- OQI-006: ML Signals (Completado)
|
|
- OQI-007: LLM Agent base (Completado)
|
|
|
|
### Habilita:
|
|
- OQI-004: Investment Accounts
|
|
- OQI-011: Auto-Trading (futuro)
|
|
|
|
---
|
|
|
|
## Referencias
|
|
|
|
- [README Epica](./README.md)
|
|
- [Integracion LLM Fine-Tuning](../../01-arquitectura/INTEGRACION-LLM-FINE-TUNING.md)
|
|
- [MCP Binance Spec](../../01-arquitectura/MCP-BINANCE-CONNECTOR-SPEC.md)
|
|
- [Plan ML-LLM-Trading](../../../orchestration/planes/PLAN-ML-LLM-TRADING.md)
|
|
|
|
---
|
|
|
|
**Generado:** 2026-01-04
|
|
**Actualizado:** 2026-02-06
|