Compare commits
No commits in common. "f8252d471ea1564466d5ae06a822337f1ec4b77f" and "a7cca885f0961bf6ea8bb3d65a0c87c5cd3cc40d" have entirely different histories.
f8252d471e
...
a7cca885f0
@ -1,4 +1,4 @@
|
||||
# Guia para Agentes de IA - Trading Platform (Trading Platform)
|
||||
# Guia para Agentes de IA - Trading Platform (OrbiQuant)
|
||||
|
||||
**Version:** 1.0
|
||||
**Ultima actualizacion:** 2026-01-04
|
||||
|
||||
16
README.md
16
README.md
@ -1,8 +1,8 @@
|
||||
# Trading Platform - Trading Platform
|
||||
# OrbiQuant IA - Trading Platform
|
||||
|
||||
## Descripción
|
||||
|
||||
**Trading Platform** es una plataforma integral de gestión de inversiones asistida por inteligencia artificial que combina:
|
||||
**OrbiQuant IA** es una plataforma integral de gestión de inversiones asistida por inteligencia artificial que combina:
|
||||
|
||||
- **Money Manager con IA**: Agentes que gestionan cuentas de trading e inversión con diferentes perfiles de riesgo (conservador, moderado, agresivo)
|
||||
- **Plataforma Educativa**: Cursos de trading accesibles generados con IA
|
||||
@ -28,7 +28,7 @@
|
||||
| LLM Agent | Python + FastAPI + Ollama | 3085 |
|
||||
| Trading Agents | Python + FastAPI + CCXT | 3086 |
|
||||
| Ollama WebUI | Interfaz gestión modelos LLM | 3087 |
|
||||
| Database | PostgreSQL 16 (trading_platform) | 5432 |
|
||||
| Database | PostgreSQL 16 (orbiquant_platform) | 5432 |
|
||||
| Cache | Redis 7 | 6379 |
|
||||
|
||||
## Estructura del Proyecto
|
||||
@ -165,9 +165,9 @@ docker-compose up -d
|
||||
|
||||
### TypeScript
|
||||
```typescript
|
||||
import { Trading PlatformClient } from '@trading-platform/sdk-typescript';
|
||||
import { OrbiQuantClient } from '@orbiquant/sdk-typescript';
|
||||
|
||||
const client = new Trading PlatformClient({
|
||||
const client = new OrbiQuantClient({
|
||||
baseUrl: 'http://localhost:3000',
|
||||
});
|
||||
|
||||
@ -185,10 +185,10 @@ const response = await client.ml.chat({
|
||||
|
||||
### Python
|
||||
```python
|
||||
from trading_sdk import Trading PlatformClient, Config
|
||||
from orbiquant_sdk import OrbiQuantClient, Config
|
||||
|
||||
config = Config.from_env()
|
||||
async with Trading PlatformClient(config) as client:
|
||||
async with OrbiQuantClient(config) as client:
|
||||
# Obtener predicción
|
||||
prediction = await client.get_prediction("BTCUSDT", "1h")
|
||||
|
||||
@ -216,7 +216,7 @@ async with Trading PlatformClient(config) as client:
|
||||
## Documentación
|
||||
|
||||
- [Análisis de Migración e Integración](./docs/00-overview/ANALISIS-MIGRACION-INTEGRACION.md)
|
||||
- [Requerimientos MVP](./docs/00-overview/REQUERIMIENTOS-MVP.md)
|
||||
- [Requerimientos MVP](./docs/00-overview/REQUERIMIENTOS-MVP-ORBIQUANT.md)
|
||||
- [Servicios](./SERVICES.md)
|
||||
- [Próxima Acción](./orchestration/PROXIMA-ACCION.md)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# MCP Binance Connector Dockerfile
|
||||
# Trading Platform
|
||||
# OrbiQuant Trading Platform
|
||||
# Version: 1.0.0
|
||||
|
||||
# ==========================================
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Date:** 2026-01-04
|
||||
**System:** Trading Platform + NEXUS v3.4 + SIMCO
|
||||
**System:** OrbiQuant Trading Platform + NEXUS v3.4 + SIMCO
|
||||
|
||||
---
|
||||
|
||||
@ -342,4 +342,4 @@ The order may exceed configured limits. Check:
|
||||
---
|
||||
|
||||
**Maintained by:** @PERFIL_MCP_DEVELOPER
|
||||
**Project:** Trading Platform
|
||||
**Project:** OrbiQuant Trading Platform
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
"trading",
|
||||
"ccxt"
|
||||
],
|
||||
"author": "Trading Platform Trading Platform",
|
||||
"author": "OrbiQuant Trading Platform",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Manages environment variables and creates Binance clients via CCXT.
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import ccxt from 'ccxt';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Uses CCXT library to communicate with Binance API.
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import express, { Request, Response, NextFunction } from 'express';
|
||||
@ -292,7 +292,7 @@ if (!configValidation.valid) {
|
||||
app.listen(PORT, () => {
|
||||
console.log('');
|
||||
console.log('================================================================');
|
||||
console.log(' MCP Binance Connector - Trading Platform Trading Platform ');
|
||||
console.log(' MCP Binance Connector - OrbiQuant Trading Platform ');
|
||||
console.log('================================================================');
|
||||
console.log(` Service: ${SERVICE_NAME}`);
|
||||
console.log(` Version: ${VERSION}`);
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Pre-trade risk validation to ensure orders comply with risk limits.
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import { riskConfig } from '../config';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Provides a unified interface for both Spot and Futures trading.
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import ccxt, { Ticker, OrderBook, OHLCV, Balance, Order, Trade } from 'ccxt';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* - binance_get_open_orders: Get all open orders
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Exports all Binance MCP tools and their schemas for registration
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
// Import handlers for use in toolHandlers map
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* - binance_get_klines: Get OHLCV candles
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* - binance_cancel_order: Cancel a pending order
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Winston-based logging for the MCP Binance Connector.
|
||||
*
|
||||
* @version 1.0.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import winston from 'winston';
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
**Version:** 0.1.0
|
||||
**Date:** 2026-01-04
|
||||
**System:** Trading Platform + NEXUS v3.4 + SIMCO
|
||||
**System:** OrbiQuant Trading Platform + NEXUS v3.4 + SIMCO
|
||||
|
||||
---
|
||||
|
||||
@ -274,4 +274,4 @@ curl http://localhost:3605/tools/mt4_execute_trade
|
||||
---
|
||||
|
||||
**Maintained by:** @PERFIL_MCP_DEVELOPER
|
||||
**Project:** Trading Platform
|
||||
**Project:** OrbiQuant Trading Platform
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
**Version:** 0.1.0
|
||||
**Date:** 2026-01-04
|
||||
**System:** Trading Platform
|
||||
**System:** OrbiQuant Trading Platform
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
"trading",
|
||||
"forex"
|
||||
],
|
||||
"author": "Trading Platform Trading Platform",
|
||||
"author": "OrbiQuant Trading Platform",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.0.0",
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Communicates with mt4-gateway service to execute trading operations.
|
||||
*
|
||||
* @version 0.1.0
|
||||
* @author Trading Platform Trading Platform
|
||||
* @author OrbiQuant Trading Platform
|
||||
*/
|
||||
|
||||
import express, { Request, Response, NextFunction } from 'express';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
version: '3.8'
|
||||
|
||||
# Trading Platform - Trading Platform Services
|
||||
# OrbiQuant IA - Trading Platform Services
|
||||
# ML Engine, LLM Agent, Trading Agents
|
||||
|
||||
services:
|
||||
@ -11,12 +11,12 @@ services:
|
||||
build:
|
||||
context: ./apps/ml-engine
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-ml-engine
|
||||
container_name: orbiquant-ml-engine
|
||||
ports:
|
||||
- "8001:8000"
|
||||
environment:
|
||||
- ENV=development
|
||||
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/trading
|
||||
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/orbiquant
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
- GPU_ENABLED=true
|
||||
volumes:
|
||||
@ -33,7 +33,7 @@ services:
|
||||
- postgres
|
||||
- redis
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
@ -47,7 +47,7 @@ services:
|
||||
build:
|
||||
context: ./apps/llm-agent
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-llm-agent
|
||||
container_name: orbiquant-llm-agent
|
||||
ports:
|
||||
- "8003:8000"
|
||||
environment:
|
||||
@ -66,7 +66,7 @@ services:
|
||||
- ml-engine
|
||||
- redis
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
@ -78,7 +78,7 @@ services:
|
||||
# ============================================
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
container_name: trading-ollama
|
||||
container_name: orbiquant-ollama
|
||||
ports:
|
||||
- "11434:11434"
|
||||
volumes:
|
||||
@ -91,7 +91,7 @@ services:
|
||||
count: 1
|
||||
capabilities: [gpu]
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
|
||||
interval: 30s
|
||||
@ -105,13 +105,13 @@ services:
|
||||
build:
|
||||
context: ./apps/trading-agents
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-trading-agents
|
||||
container_name: orbiquant-trading-agents
|
||||
ports:
|
||||
- "8004:8000"
|
||||
environment:
|
||||
- ENV=development
|
||||
- ML_ENGINE_URL=http://ml-engine:8000
|
||||
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/trading
|
||||
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/orbiquant
|
||||
- REDIS_URL=redis://redis:6379/2
|
||||
- BINANCE_TESTNET=true
|
||||
- BINANCE_API_KEY=${BINANCE_API_KEY:-}
|
||||
@ -124,7 +124,7 @@ services:
|
||||
- postgres
|
||||
- redis
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
@ -137,18 +137,18 @@ services:
|
||||
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: trading-postgres
|
||||
container_name: orbiquant-postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_DB=trading
|
||||
- POSTGRES_DB=orbiquant
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
- ./apps/database/schemas:/docker-entrypoint-initdb.d
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
@ -157,14 +157,14 @@ services:
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: trading-redis
|
||||
container_name: orbiquant-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
command: redis-server --appendonly yes
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
@ -178,7 +178,7 @@ services:
|
||||
# Ollama Web UI para testing
|
||||
ollama-webui:
|
||||
image: ghcr.io/open-webui/open-webui:main
|
||||
container_name: trading-ollama-webui
|
||||
container_name: orbiquant-ollama-webui
|
||||
ports:
|
||||
- "3001:8080"
|
||||
environment:
|
||||
@ -188,7 +188,7 @@ services:
|
||||
depends_on:
|
||||
- ollama
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
profiles:
|
||||
- debug
|
||||
|
||||
@ -201,5 +201,5 @@ volumes:
|
||||
trading-data:
|
||||
|
||||
networks:
|
||||
trading-network:
|
||||
orbiquant-network:
|
||||
driver: bridge
|
||||
|
||||
@ -1,34 +1,56 @@
|
||||
version: '3.8'
|
||||
|
||||
# =============================================================================
|
||||
# TRADING PLATFORM - Docker Compose Configuration
|
||||
# ORBIQUANT IA TRADING PLATFORM - Docker Compose Configuration
|
||||
# =============================================================================
|
||||
# Este archivo define los servicios de APLICACION del proyecto.
|
||||
# PostgreSQL y Redis usan instancias NATIVAS compartidas del workspace.
|
||||
# Ref: orchestration/inventarios/DEVENV-PORTS-INVENTORY.yml
|
||||
# Fecha: 2026-01-07
|
||||
# =============================================================================
|
||||
#
|
||||
# IMPORTANTE - Arquitectura de Instancia Unica Compartida:
|
||||
# - PostgreSQL: Instancia nativa en puerto 5432 (NO Docker)
|
||||
# - Redis: Instancia nativa en puerto 6379 (NO Docker)
|
||||
# - Los proyectos se separan por DATABASE + USER, no por puerto
|
||||
#
|
||||
# Este archivo define todos los servicios del proyecto para desarrollo
|
||||
# Fecha: 2025-12-05
|
||||
# =============================================================================
|
||||
|
||||
services:
|
||||
# ===========================================================================
|
||||
# NOTA: PostgreSQL y Redis son NATIVOS (no Docker)
|
||||
# ===========================================================================
|
||||
# PostgreSQL nativo: localhost:5432
|
||||
# - Database: trading_platform
|
||||
# - User: trading_user
|
||||
# - Password: trading_dev_2025
|
||||
#
|
||||
# Redis nativo: localhost:6379
|
||||
# - DB: 1 (asignado a trading-platform)
|
||||
# INFRASTRUCTURE SERVICES
|
||||
# ===========================================================================
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: orbiquantia-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: orbiquantia_platform
|
||||
POSTGRES_USER: orbiquantia
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-orbiquantia_dev_2025}
|
||||
POSTGRES_INITDB_ARGS: "-E UTF8"
|
||||
ports:
|
||||
- "${POSTGRES_PORT:-5433}:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./apps/database/schemas:/docker-entrypoint-initdb.d:ro
|
||||
networks:
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U orbiquantia -d orbiquantia_platform"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: orbiquant-redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- orbiquant-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# ===========================================================================
|
||||
# BACKEND SERVICES
|
||||
# ===========================================================================
|
||||
@ -37,21 +59,18 @@ services:
|
||||
build:
|
||||
context: ./apps/backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-backend
|
||||
container_name: orbiquant-backend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV:-development}
|
||||
PORT: ${BACKEND_API_PORT:-3081}
|
||||
# PostgreSQL nativo (host.docker.internal para acceder desde Docker a host)
|
||||
DB_HOST: host.docker.internal
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
DB_NAME: trading_platform
|
||||
DB_USER: trading_user
|
||||
DB_PASSWORD: ${DB_PASSWORD:-trading_dev_2025}
|
||||
# Redis nativo
|
||||
REDIS_HOST: host.docker.internal
|
||||
DB_NAME: orbiquantia_platform
|
||||
DB_USER: orbiquantia
|
||||
DB_PASSWORD: ${POSTGRES_PASSWORD:-orbiquantia_dev_2025}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_DB: 1
|
||||
ML_ENGINE_URL: http://ml-engine:3083
|
||||
FRONTEND_URL: http://localhost:${FRONTEND_WEB_PORT:-3080}
|
||||
JWT_ACCESS_SECRET: ${JWT_ACCESS_SECRET}
|
||||
@ -64,9 +83,12 @@ services:
|
||||
- ./apps/backend/src:/app/src
|
||||
- backend_node_modules:/app/node_modules
|
||||
networks:
|
||||
- trading-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- orbiquant-network
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
command: npm run dev
|
||||
|
||||
# ===========================================================================
|
||||
@ -77,7 +99,7 @@ services:
|
||||
build:
|
||||
context: ./apps/frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-frontend
|
||||
container_name: orbiquant-frontend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
VITE_API_URL: http://localhost:${BACKEND_API_PORT:-3081}/api/v1
|
||||
@ -90,7 +112,7 @@ services:
|
||||
- ./apps/frontend/public:/app/public
|
||||
- frontend_node_modules:/app/node_modules
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
depends_on:
|
||||
- backend
|
||||
command: npm run dev -- --host 0.0.0.0 --port 3080
|
||||
@ -103,20 +125,17 @@ services:
|
||||
build:
|
||||
context: ./apps/ml-engine
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-ml-engine
|
||||
container_name: orbiquant-ml-engine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PYTHONUNBUFFERED: 1
|
||||
# PostgreSQL nativo
|
||||
DB_HOST: host.docker.internal
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
DB_NAME: trading_platform
|
||||
DB_USER: trading_user
|
||||
DB_PASSWORD: ${DB_PASSWORD:-trading_dev_2025}
|
||||
# Redis nativo
|
||||
REDIS_HOST: host.docker.internal
|
||||
DB_NAME: orbiquantia_platform
|
||||
DB_USER: orbiquantia
|
||||
DB_PASSWORD: ${POSTGRES_PASSWORD:-orbiquantia_dev_2025}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_DB: 1
|
||||
PORT: ${ML_ENGINE_PORT:-3083}
|
||||
LOG_LEVEL: INFO
|
||||
ports:
|
||||
@ -126,25 +145,27 @@ services:
|
||||
- ./apps/ml-engine/models:/app/models
|
||||
- ml_models:/app/trained_models
|
||||
networks:
|
||||
- trading-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- orbiquant-network
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
command: uvicorn src.api.main:app --host 0.0.0.0 --port 3083 --reload
|
||||
|
||||
data-service:
|
||||
build:
|
||||
context: ./apps/data-service
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-data-service
|
||||
container_name: orbiquant-data-service
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PYTHONUNBUFFERED: 1
|
||||
# PostgreSQL nativo
|
||||
DB_HOST: host.docker.internal
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
DB_NAME: trading_platform
|
||||
DB_USER: trading_user
|
||||
DB_PASSWORD: ${DB_PASSWORD:-trading_dev_2025}
|
||||
DB_NAME: orbiquantia_platform
|
||||
DB_USER: orbiquantia
|
||||
DB_PASSWORD: ${POSTGRES_PASSWORD:-orbiquantia_dev_2025}
|
||||
POLYGON_API_KEY: ${POLYGON_API_KEY}
|
||||
METAAPI_TOKEN: ${METAAPI_TOKEN}
|
||||
METAAPI_ACCOUNT_ID: ${METAAPI_ACCOUNT_ID}
|
||||
@ -156,99 +177,22 @@ services:
|
||||
volumes:
|
||||
- ./apps/data-service/src:/app/src
|
||||
networks:
|
||||
- trading-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- orbiquant-network
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
command: python -m src.main
|
||||
|
||||
llm-agent:
|
||||
build:
|
||||
context: ./apps/llm-agent
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-llm-agent
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PYTHONUNBUFFERED: 1
|
||||
PORT: ${LLM_AGENT_PORT:-3085}
|
||||
ML_ENGINE_URL: http://ml-engine:3083
|
||||
DATA_SERVICE_URL: http://data-service:3084
|
||||
# PostgreSQL nativo
|
||||
DB_HOST: host.docker.internal
|
||||
DB_PORT: 5432
|
||||
DB_NAME: trading_platform
|
||||
DB_USER: trading_user
|
||||
DB_PASSWORD: ${DB_PASSWORD:-trading_dev_2025}
|
||||
# Redis nativo
|
||||
REDIS_HOST: host.docker.internal
|
||||
REDIS_PORT: 6379
|
||||
REDIS_DB: 1
|
||||
LLM_PROVIDER: ${LLM_PROVIDER:-ollama}
|
||||
LLM_MODEL: ${LLM_MODEL:-llama3.2}
|
||||
OLLAMA_URL: ${OLLAMA_URL:-http://host.docker.internal:11434}
|
||||
LOG_LEVEL: INFO
|
||||
ports:
|
||||
- "${LLM_AGENT_PORT:-3085}:3085"
|
||||
volumes:
|
||||
- ./apps/llm-agent/src:/app/src
|
||||
- ./apps/llm-agent/config:/app/config
|
||||
networks:
|
||||
- trading-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
depends_on:
|
||||
- ml-engine
|
||||
- data-service
|
||||
command: uvicorn src.api.main:app --host 0.0.0.0 --port 3085 --reload
|
||||
|
||||
trading-agents:
|
||||
build:
|
||||
context: ./apps/trading-agents
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-trading-agents
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PYTHONUNBUFFERED: 1
|
||||
PORT: ${TRADING_AGENTS_PORT:-3086}
|
||||
ML_ENGINE_URL: http://ml-engine:3083
|
||||
LLM_AGENT_URL: http://llm-agent:3085
|
||||
DATA_SERVICE_URL: http://data-service:3084
|
||||
# PostgreSQL nativo
|
||||
DB_HOST: host.docker.internal
|
||||
DB_PORT: 5432
|
||||
DB_NAME: trading_platform
|
||||
DB_USER: trading_user
|
||||
DB_PASSWORD: ${DB_PASSWORD:-trading_dev_2025}
|
||||
# Redis nativo
|
||||
REDIS_HOST: host.docker.internal
|
||||
REDIS_PORT: 6379
|
||||
REDIS_DB: 1
|
||||
EXCHANGE_MODE: ${EXCHANGE_MODE:-paper}
|
||||
INITIAL_BALANCE: ${INITIAL_BALANCE:-100000}
|
||||
LOG_LEVEL: INFO
|
||||
ports:
|
||||
- "${TRADING_AGENTS_PORT:-3086}:3086"
|
||||
volumes:
|
||||
- ./apps/trading-agents/src:/app/src
|
||||
- ./apps/trading-agents/config:/app/config
|
||||
networks:
|
||||
- trading-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
depends_on:
|
||||
- ml-engine
|
||||
- llm-agent
|
||||
command: uvicorn src.api.main:app --host 0.0.0.0 --port 3086 --reload
|
||||
|
||||
# ===========================================================================
|
||||
# DEVELOPMENT TOOLS (Optional)
|
||||
# ===========================================================================
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
container_name: trading-pgadmin
|
||||
container_name: orbiquant-pgadmin
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@trading-platform.local}
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@orbiquant.io}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
|
||||
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
||||
ports:
|
||||
@ -256,29 +200,32 @@ services:
|
||||
volumes:
|
||||
- pgadmin_data:/var/lib/pgadmin
|
||||
networks:
|
||||
- trading-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- orbiquant-network
|
||||
depends_on:
|
||||
- postgres
|
||||
profiles:
|
||||
- dev-tools
|
||||
|
||||
mailhog:
|
||||
image: mailhog/mailhog:latest
|
||||
container_name: trading-mailhog
|
||||
container_name: orbiquant-mailhog
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${MAILHOG_SMTP_PORT:-1025}:1025" # SMTP
|
||||
- "${MAILHOG_WEB_PORT:-8025}:8025" # Web UI
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
profiles:
|
||||
- dev-tools
|
||||
|
||||
# =============================================================================
|
||||
# VOLUMES
|
||||
# =============================================================================
|
||||
# NOTA: postgres_data y redis_data eliminados - se usan instancias nativas
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
backend_node_modules:
|
||||
driver: local
|
||||
frontend_node_modules:
|
||||
@ -292,9 +239,9 @@ volumes:
|
||||
# NETWORKS
|
||||
# =============================================================================
|
||||
networks:
|
||||
trading-network:
|
||||
orbiquant-network:
|
||||
driver: bridge
|
||||
name: trading-network
|
||||
name: orbiquant-network
|
||||
|
||||
# =============================================================================
|
||||
# USAGE INSTRUCTIONS
|
||||
|
||||
@ -1,49 +1,20 @@
|
||||
---
|
||||
id: "NOTA-DISCREPANCIA-PUERTOS-2025-12-08"
|
||||
title: "Discrepancia de Puertos - RESUELTA"
|
||||
title: "Discrepancia de Puertos Detectada"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "2.0.0"
|
||||
updated_date: "2026-01-07"
|
||||
status: "RESUELTO"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# NOTA: Discrepancia de Puertos - RESUELTA
|
||||
# NOTA: Discrepancia de Puertos Detectada
|
||||
|
||||
**Fecha Original:** 2025-12-08
|
||||
**Fecha Resolución:** 2026-01-07
|
||||
**Fecha:** 2025-12-08
|
||||
**Para:** DevEnv-Agent
|
||||
**De:** Requirements-Analyst / Claude Code
|
||||
**Urgencia:** ~~Media~~ RESUELTA
|
||||
**De:** Requirements-Analyst
|
||||
**Urgencia:** Media
|
||||
**Proyecto:** trading-platform
|
||||
|
||||
## RESOLUCIÓN (2026-01-07)
|
||||
|
||||
La discrepancia ha sido resuelta alineando todos los archivos con la fuente de verdad oficial:
|
||||
- **Fuente de verdad:** `/home/isem/workspace-v1/control-plane/registries/ports.registry.yml`
|
||||
|
||||
### Puertos Oficiales Aplicados:
|
||||
| Servicio | Puerto |
|
||||
|----------|--------|
|
||||
| Frontend | 3080 |
|
||||
| Backend | 3081 |
|
||||
| WebSocket | 3082 |
|
||||
| ML Engine | 3083 |
|
||||
| Data Service | 3084 |
|
||||
| LLM Agent | 3085 |
|
||||
| Trading Agents | 3086 |
|
||||
|
||||
### Archivos Actualizados:
|
||||
- [x] `docker-compose.yml`
|
||||
- [x] `apps/*/\*.env.example` (5 archivos)
|
||||
- [x] `apps/ml-engine/config/database.yaml`
|
||||
- [x] `apps/frontend/src/services/*.ts` (4 archivos)
|
||||
- [x] `orchestration/inventarios/MASTER_INVENTORY.yml`
|
||||
|
||||
---
|
||||
|
||||
## Historial Original (para referencia)
|
||||
|
||||
---
|
||||
|
||||
## Descripcion del Problema
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
---
|
||||
id: "ARQUITECTURA-GENERAL"
|
||||
title: "Arquitectura General - Trading Platform"
|
||||
title: "Arquitectura General - OrbiQuant IA"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Arquitectura General - Trading Platform
|
||||
# Arquitectura General - OrbiQuant IA
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
---
|
||||
id: "STACK-TECNOLOGICO"
|
||||
title: "Stack Tecnologico - Trading Platform"
|
||||
title: "Stack Tecnologico - OrbiQuant IA"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Stack Tecnologico - Trading Platform
|
||||
# Stack Tecnologico - OrbiQuant IA
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
@ -261,7 +261,7 @@ from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
import numpy as np
|
||||
|
||||
app = FastAPI(title="Trading Platform ML Engine")
|
||||
app = FastAPI(title="OrbiQuant ML Engine")
|
||||
|
||||
class PredictionRequest(BaseModel):
|
||||
symbol: str
|
||||
@ -389,7 +389,7 @@ const client = twilio(accountSid, authToken);
|
||||
|
||||
// Send WhatsApp OTP
|
||||
await client.messages.create({
|
||||
body: `Tu codigo Trading Platform: ${otp}`,
|
||||
body: `Tu codigo OrbiQuant: ${otp}`,
|
||||
from: 'whatsapp:+14155238886',
|
||||
to: `whatsapp:${phoneNumber}`,
|
||||
});
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
---
|
||||
id: "VISION-PRODUCTO"
|
||||
title: "Vision del Producto - Trading Platform"
|
||||
title: "Vision del Producto - OrbiQuant IA"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Vision del Producto - Trading Platform
|
||||
# Vision del Producto - OrbiQuant IA
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
|
||||
@ -11,13 +11,13 @@ updated_date: "2026-01-04"
|
||||
**Ultima actualizacion:** 2025-12-05
|
||||
**Estado:** ✅ Completado
|
||||
**Version:** 1.0.0
|
||||
**Proposito:** Documentacion de alto nivel del proyecto Trading Platform
|
||||
**Proposito:** Documentacion de alto nivel del proyecto OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
## Proposito
|
||||
|
||||
Esta carpeta contiene la vision general, arquitectura y definiciones fundamentales del proyecto Trading Platform. Sirve como punto de entrada para entender el alcance, objetivos y estructura tecnica de la plataforma.
|
||||
Esta carpeta contiene la vision general, arquitectura y definiciones fundamentales del proyecto OrbiQuant IA. Sirve como punto de entrada para entender el alcance, objetivos y estructura tecnica de la plataforma.
|
||||
|
||||
---
|
||||
|
||||
@ -37,7 +37,7 @@ Esta carpeta contiene la vision general, arquitectura y definiciones fundamental
|
||||
|
||||
## Vision del Producto
|
||||
|
||||
**Trading Platform** es una plataforma SaaS que democratiza el acceso a herramientas de trading e inversion profesionales mediante:
|
||||
**OrbiQuant IA** es una plataforma SaaS que democratiza el acceso a herramientas de trading e inversion profesionales mediante:
|
||||
|
||||
1. **Educacion Accesible** - Cursos estructurados de trading
|
||||
2. **Agentes IA** - Gestion automatizada de inversiones
|
||||
@ -59,7 +59,7 @@ Esta carpeta contiene la vision general, arquitectura y definiciones fundamental
|
||||
|
||||
## Diferenciadores Clave
|
||||
|
||||
| Competidor | Trading Platform Diferenciador |
|
||||
| Competidor | OrbiQuant Diferenciador |
|
||||
|------------|------------------------|
|
||||
| Trade Republic | + Educacion integrada + Agentes IA personalizables |
|
||||
| eToro | + Sin comisiones ocultas + ML transparente |
|
||||
|
||||
@ -30,7 +30,7 @@ Este documento describe la arquitectura de integracion entre:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ TRADING PLATFORM ARCHITECTURE │
|
||||
│ ORBIQUANT IA - TRADING PLATFORM ARCHITECTURE │
|
||||
├─────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────────────────────┐ │
|
||||
@ -249,4 +249,4 @@ Response ──► MT4 Gateway ──► MCP Server ──► LLM Agent ──
|
||||
---
|
||||
|
||||
*Documento generado por Tech-Leader Agent*
|
||||
*Trading Platform*
|
||||
*OrbiQuant IA Trading Platform*
|
||||
|
||||
@ -29,7 +29,7 @@ Esta arquitectura permite ejecutar **múltiples agentes de trading**, cada uno c
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ TRADING MULTI-AGENT PLATFORM │
|
||||
│ ORBIQUANT MULTI-AGENT PLATFORM │
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌────────────────────────────────────────────────────────────────────────┐ │
|
||||
@ -214,7 +214,7 @@ class MT4Client:
|
||||
lots: float,
|
||||
sl: Optional[float] = None,
|
||||
tp: Optional[float] = None,
|
||||
comment: str = "Trading Platform"
|
||||
comment: str = "OrbiQuant"
|
||||
) -> Dict:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.post(
|
||||
@ -309,7 +309,7 @@ async def execute_agent_trade(
|
||||
lots=trade_request["lots"],
|
||||
sl=trade_request.get("sl"),
|
||||
tp=trade_request.get("tp"),
|
||||
comment=f"Trading Platform-{config['name']}"
|
||||
comment=f"OrbiQuant-{config['name']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
---
|
||||
id: "ARQUITECTURA-UNIFICADA"
|
||||
title: "Arquitectura Unificada - Trading Platform"
|
||||
title: "Arquitectura Unificada - OrbiQuant IA Trading Platform"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Arquitectura Unificada - Trading Platform
|
||||
# Arquitectura Unificada - OrbiQuant IA Trading Platform
|
||||
|
||||
**Versión:** 2.0.0
|
||||
**Última actualización:** 2025-12-05
|
||||
@ -17,7 +17,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen Ejecutivo
|
||||
|
||||
Este documento define la arquitectura completa de Trading Platform, integrando el sistema TradingAgent existente con la nueva plataforma de trading. Define cómo interactúan todos los componentes para ofrecer una experiencia completa de Money Manager con IA.
|
||||
Este documento define la arquitectura completa de OrbiQuant IA, integrando el sistema TradingAgent existente con la nueva plataforma de trading. Define cómo interactúan todos los componentes para ofrecer una experiencia completa de Money Manager con IA.
|
||||
|
||||
---
|
||||
|
||||
@ -25,7 +25,7 @@ Este documento define la arquitectura completa de Trading Platform, integrando e
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ TRADING PLATFORM │
|
||||
│ ORBIQUANT IA PLATFORM │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ FRONTEND LAYER │ │
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
---
|
||||
id: "DIAGRAMA-INTEGRACIONES"
|
||||
title: "Diagrama de Integraciones - Trading Platform"
|
||||
title: "Diagrama de Integraciones - OrbiQuant IA Trading Platform"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Diagrama de Integraciones - Trading Platform
|
||||
# Diagrama de Integraciones - OrbiQuant IA Trading Platform
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
@ -18,7 +18,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## 1. Resumen Ejecutivo
|
||||
|
||||
Este documento detalla todos los flujos de integracion entre componentes del sistema Trading Platform, incluyendo:
|
||||
Este documento detalla todos los flujos de integracion entre componentes del sistema OrbiQuant IA, incluyendo:
|
||||
- **Flujos de datos** entre servicios
|
||||
- **APIs y endpoints** disponibles
|
||||
- **Eventos y webhooks** para comunicacion asincrona
|
||||
@ -338,8 +338,8 @@ Este documento detalla todos los flujos de integracion entre componentes del sis
|
||||
│ HTTPS │ {
|
||||
└────┬────────────┘ "mode": "subscription",
|
||||
│ "line_items": [{ price: "price_pro" }],
|
||||
│ "success_url": "https://app.trading.com/success",
|
||||
│ "cancel_url": "https://app.trading.com/cancel"
|
||||
│ "success_url": "https://app.orbiquant.com/success",
|
||||
│ "cancel_url": "https://app.orbiquant.com/cancel"
|
||||
│ }
|
||||
│
|
||||
│ Response: { url: "checkout.stripe.com/..." }
|
||||
@ -372,7 +372,7 @@ Este documento detalla todos los flujos de integracion entre componentes del sis
|
||||
│ 5. Webhook trigger (async)
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ Stripe │ POST https://api.trading.com/payments/webhook
|
||||
│ Stripe │ POST https://api.orbiquant.com/payments/webhook
|
||||
│ Webhook │ Headers:
|
||||
└────┬────────────┘ Stripe-Signature: t=...,v1=...
|
||||
│ Body:
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-08
|
||||
**Modulo:** Data Services
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -890,7 +890,7 @@ from pydantic import BaseModel
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
app = FastAPI(title="Trading Platform Data Service")
|
||||
app = FastAPI(title="OrbiQuant Data Service")
|
||||
|
||||
class SyncRequest(BaseModel):
|
||||
symbol: str
|
||||
@ -1005,7 +1005,7 @@ async def health():
|
||||
from celery import Celery
|
||||
from celery.schedules import crontab
|
||||
|
||||
celery_app = Celery('trading_data')
|
||||
celery_app = Celery('orbiquant_data')
|
||||
|
||||
celery_app.conf.beat_schedule = {
|
||||
# Full sync once a day at 4 AM UTC
|
||||
@ -1102,52 +1102,52 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.data
|
||||
container_name: trading-data
|
||||
container_name: orbiquant-data
|
||||
ports:
|
||||
- "3604:3604" # Data service (base 3600 + 4)
|
||||
environment:
|
||||
- API_MASSIVE_KEY=${API_MASSIVE_KEY}
|
||||
- DATABASE_URL=postgresql://trading_user:trading_dev_2025@postgres:5438/trading_data
|
||||
- DATABASE_URL=postgresql://orbiquant_user:orbiquant_dev_2025@postgres:5438/orbiquant_trading
|
||||
- REDIS_URL=redis://redis:6385
|
||||
- SERVICE_PORT=3604
|
||||
depends_on:
|
||||
- redis
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
restart: unless-stopped
|
||||
|
||||
celery-worker:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.data
|
||||
container_name: trading-celery
|
||||
container_name: orbiquant-celery
|
||||
command: celery -A tasks worker -l info
|
||||
environment:
|
||||
- API_MASSIVE_KEY=${API_MASSIVE_KEY}
|
||||
- DATABASE_URL=postgresql://trading_user:trading_dev_2025@postgres:5438/trading_data
|
||||
- DATABASE_URL=postgresql://orbiquant_user:orbiquant_dev_2025@postgres:5438/orbiquant_trading
|
||||
- REDIS_URL=redis://redis:6385
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
restart: unless-stopped
|
||||
|
||||
celery-beat:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.data
|
||||
container_name: trading-beat
|
||||
container_name: orbiquant-beat
|
||||
command: celery -A tasks beat -l info
|
||||
environment:
|
||||
- REDIS_URL=redis://redis:6385
|
||||
depends_on:
|
||||
- redis
|
||||
networks:
|
||||
- trading-network
|
||||
- orbiquant-network
|
||||
restart: unless-stopped
|
||||
|
||||
# Redis dedicado para trading-platform (puerto 6385)
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: trading-redis
|
||||
container_name: orbiquant-redis
|
||||
ports:
|
||||
- "6385:6379"
|
||||
volumes:
|
||||
@ -1155,7 +1155,7 @@ services:
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
trading-network:
|
||||
orbiquant-network:
|
||||
external: true # Red compartida del workspace
|
||||
|
||||
volumes:
|
||||
@ -1165,4 +1165,4 @@ volumes:
|
||||
---
|
||||
|
||||
**Documento Generado:** 2025-12-08
|
||||
**Trading Strategist - Trading Platform**
|
||||
**Trading Strategist - OrbiQuant IA**
|
||||
|
||||
@ -6,7 +6,7 @@ project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
created_date: "2026-01-04"
|
||||
updated_date: "2026-01-04"
|
||||
author: "Orquestador Agent - Trading Platform"
|
||||
author: "Orquestador Agent - OrbiQuant IA"
|
||||
---
|
||||
|
||||
# Integracion LLM con Fine-Tuning para Trading Agent
|
||||
@ -50,7 +50,7 @@ Crear un agente LLM inteligente que funcione como cerebro del sistema de trading
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ LLM TRADING AGENT │
|
||||
│ ORBIQUANT LLM TRADING AGENT │
|
||||
├─────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌───────────────────────────────────────────────────────────────────────────┐ │
|
||||
@ -185,7 +185,7 @@ El fine-tuning se realizara con definiciones de estrategias de trading:
|
||||
```yaml
|
||||
# Estructura del dataset de fine-tuning
|
||||
dataset:
|
||||
name: trading_data_strategies_v1
|
||||
name: orbiquant_trading_strategies_v1
|
||||
format: JSONL
|
||||
|
||||
categories:
|
||||
@ -241,7 +241,7 @@ lora_config = LoraConfig(
|
||||
|
||||
# Training config optimizado para GPU 16GB
|
||||
training_args = TrainingArguments(
|
||||
output_dir="./trading-llm-finetuned",
|
||||
output_dir="./orbiquant-llm-finetuned",
|
||||
per_device_train_batch_size=4,
|
||||
gradient_accumulation_steps=4,
|
||||
num_train_epochs=3,
|
||||
@ -1338,14 +1338,14 @@ Esperar confirmacion de nueva fase con:
|
||||
|
||||
# Configuracion
|
||||
MODEL_NAME="meta-llama/Meta-Llama-3-8B-Instruct"
|
||||
OUTPUT_DIR="./trading-llm-finetuned"
|
||||
OUTPUT_DIR="./orbiquant-llm-finetuned"
|
||||
DATASET_PATH="./data/trading_strategies.jsonl"
|
||||
|
||||
# Verificar GPU
|
||||
nvidia-smi
|
||||
|
||||
# Activar ambiente
|
||||
source activate trading-llm
|
||||
source activate orbiquant-llm
|
||||
|
||||
# Ejecutar entrenamiento
|
||||
python train_lora.py \
|
||||
@ -1391,7 +1391,7 @@ services:
|
||||
# Ollama con modelo fine-tuned
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
container_name: trading-ollama
|
||||
container_name: orbiquant-ollama
|
||||
ports:
|
||||
- "11434:11434"
|
||||
volumes:
|
||||
@ -1413,14 +1413,14 @@ services:
|
||||
build:
|
||||
context: ./apps/llm-agent
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-llm-agent
|
||||
container_name: orbiquant-llm-agent
|
||||
ports:
|
||||
- "3085:3085"
|
||||
environment:
|
||||
- OLLAMA_URL=http://ollama:11434
|
||||
- LLM_MODEL=trading-trading:latest # Modelo fine-tuned
|
||||
- LLM_MODEL=orbiquant-trading:latest # Modelo fine-tuned
|
||||
- REDIS_URL=redis://redis:6379
|
||||
- DATABASE_URL=postgresql://user:pass@postgres:5432/trading
|
||||
- DATABASE_URL=postgresql://user:pass@postgres:5432/orbiquant
|
||||
- ML_ENGINE_URL=http://ml-engine:3083
|
||||
- MCP_MT4_URL=http://mcp-mt4:3605
|
||||
- MCP_BINANCE_URL=http://mcp-binance:3606
|
||||
@ -1435,7 +1435,7 @@ services:
|
||||
build:
|
||||
context: ./apps/mcp-mt4-connector
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-mcp-mt4
|
||||
container_name: orbiquant-mcp-mt4
|
||||
ports:
|
||||
- "3605:3605"
|
||||
environment:
|
||||
@ -1448,7 +1448,7 @@ services:
|
||||
build:
|
||||
context: ./apps/mcp-binance-connector
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-mcp-binance
|
||||
container_name: orbiquant-mcp-binance
|
||||
ports:
|
||||
- "3606:3606"
|
||||
environment:
|
||||
@ -1462,11 +1462,11 @@ services:
|
||||
build:
|
||||
context: ./apps/ml-engine
|
||||
dockerfile: Dockerfile
|
||||
container_name: trading-ml-engine
|
||||
container_name: orbiquant-ml-engine
|
||||
ports:
|
||||
- "3083:3083"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://user:pass@postgres:5432/trading
|
||||
- DATABASE_URL=postgresql://user:pass@postgres:5432/orbiquant
|
||||
- REDIS_URL=redis://redis:6379
|
||||
volumes:
|
||||
- ml_models:/app/models
|
||||
@ -1475,7 +1475,7 @@ services:
|
||||
# Redis
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: trading-redis
|
||||
container_name: orbiquant-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
@ -1485,13 +1485,13 @@ services:
|
||||
# PostgreSQL
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: trading-postgres
|
||||
container_name: orbiquant-postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_USER=user
|
||||
- POSTGRES_PASSWORD=pass
|
||||
- POSTGRES_DB=trading
|
||||
- POSTGRES_DB=orbiquant
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
@ -1509,7 +1509,7 @@ volumes:
|
||||
#!/bin/bash
|
||||
# scripts/init_llm_system.sh
|
||||
|
||||
echo "=== Trading Platform LLM Trading System Setup ==="
|
||||
echo "=== OrbiQuant LLM Trading System Setup ==="
|
||||
|
||||
# 1. Verificar GPU
|
||||
echo "[1/6] Verificando GPU..."
|
||||
@ -1522,11 +1522,11 @@ docker-compose -f docker-compose.llm-advanced.yaml up -d postgres redis
|
||||
# 3. Esperar a que postgres este listo
|
||||
echo "[3/6] Esperando PostgreSQL..."
|
||||
sleep 10
|
||||
docker exec trading-postgres pg_isready
|
||||
docker exec orbiquant-postgres pg_isready
|
||||
|
||||
# 4. Ejecutar migraciones
|
||||
echo "[4/6] Ejecutando migraciones SQL..."
|
||||
docker exec -i trading-postgres psql -U user -d trading < ./apps/database/ddl/schemas/ml/llm_predictions.sql
|
||||
docker exec -i orbiquant-postgres psql -U user -d orbiquant < ./apps/database/ddl/schemas/ml/llm_predictions.sql
|
||||
|
||||
# 5. Iniciar Ollama y cargar modelo
|
||||
echo "[5/6] Iniciando Ollama..."
|
||||
@ -1534,12 +1534,12 @@ docker-compose -f docker-compose.llm-advanced.yaml up -d ollama
|
||||
sleep 10
|
||||
|
||||
# Verificar si existe modelo fine-tuned
|
||||
if [ -f "./models/trading-trading.gguf" ]; then
|
||||
if [ -f "./models/orbiquant-trading.gguf" ]; then
|
||||
echo "Cargando modelo fine-tuned..."
|
||||
docker exec trading-ollama ollama create trading-trading -f /models/Modelfile
|
||||
docker exec orbiquant-ollama ollama create orbiquant-trading -f /models/Modelfile
|
||||
else
|
||||
echo "Modelo fine-tuned no encontrado, usando Llama 3..."
|
||||
docker exec trading-ollama ollama pull llama3:8b-instruct-q5_K_M
|
||||
docker exec orbiquant-ollama ollama pull llama3:8b-instruct-q5_K_M
|
||||
fi
|
||||
|
||||
# 6. Iniciar resto de servicios
|
||||
@ -1695,5 +1695,5 @@ async def test_fine_tuned_trading_knowledge():
|
||||
---
|
||||
|
||||
**Documento Generado:** 2026-01-04
|
||||
**Autor:** Orquestador Agent - Trading Platform
|
||||
**Autor:** Orquestador Agent - OrbiQuant IA
|
||||
**Version:** 1.0.0
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-08
|
||||
**Modulo:** OQI-007-llm-agent
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -649,7 +649,7 @@ TOOL_DEFINITIONS = [
|
||||
```python
|
||||
# prompts/system_prompt.py
|
||||
|
||||
SYSTEM_PROMPT = """Eres Trading Platform AI, un copiloto de trading especializado en mercados de forex y metales preciosos.
|
||||
SYSTEM_PROMPT = """Eres OrbiQuant AI, un copiloto de trading especializado en mercados de forex y metales preciosos.
|
||||
|
||||
## Tu Rol
|
||||
- Analizar senales de los modelos ML y explicarlas claramente
|
||||
@ -758,7 +758,7 @@ from typing import List, Optional
|
||||
import redis
|
||||
import json
|
||||
|
||||
app = FastAPI(title="Trading Platform LLM Service")
|
||||
app = FastAPI(title="OrbiQuant LLM Service")
|
||||
|
||||
class Message(BaseModel):
|
||||
role: str # "user" or "assistant"
|
||||
@ -1009,7 +1009,7 @@ version: '3.8'
|
||||
services:
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
container_name: trading-ollama
|
||||
container_name: orbiquant-ollama
|
||||
ports:
|
||||
- "11434:11434"
|
||||
volumes:
|
||||
@ -1027,7 +1027,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.llm
|
||||
container_name: trading-llm
|
||||
container_name: orbiquant-llm
|
||||
ports:
|
||||
- "3602:3602" # LLM service (base 3600 + 2)
|
||||
environment:
|
||||
@ -1042,7 +1042,7 @@ services:
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: trading-redis
|
||||
container_name: orbiquant-redis
|
||||
ports:
|
||||
- "6385:6379" # Puerto asignado segun DEVENV-PORTS
|
||||
volumes:
|
||||
@ -1060,7 +1060,7 @@ volumes:
|
||||
#!/bin/bash
|
||||
# scripts/init_llm.sh
|
||||
|
||||
echo "=== Trading Platform LLM Setup ==="
|
||||
echo "=== OrbiQuant LLM Setup ==="
|
||||
|
||||
# 1. Check GPU
|
||||
echo "Checking GPU..."
|
||||
@ -1173,4 +1173,4 @@ async def test_response_time():
|
||||
---
|
||||
|
||||
**Documento Generado:** 2025-12-08
|
||||
**Trading Strategist - Trading Platform**
|
||||
**Trading Strategist - OrbiQuant IA**
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-08
|
||||
**Modulo:** Trading Operations
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -65,7 +65,7 @@ Integrar MetaTrader4 (MT4) como broker de ejecucion para:
|
||||
├─────────────────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Trading Platform │ │
|
||||
│ │ OrbiQuant IA │ │
|
||||
│ │ Trading Service │ │
|
||||
│ │ │ │
|
||||
│ │ ┌───────────────┐ │ ┌─────────────────────────────────────────┐ │
|
||||
@ -201,8 +201,8 @@ async def provision_account(
|
||||
'server': server,
|
||||
'platform': 'mt4',
|
||||
'magic': 123456, # Magic number for our trades
|
||||
'application': 'Trading PlatformIA',
|
||||
'keywords': ['trading', 'ml-trading']
|
||||
'application': 'OrbiQuantIA',
|
||||
'keywords': ['orbiquant', 'ml-trading']
|
||||
})
|
||||
|
||||
# Deploy and wait for connection
|
||||
@ -465,7 +465,7 @@ class TradeManager:
|
||||
stop_loss=adjusted_sl,
|
||||
take_profit=adjusted_tp,
|
||||
options={
|
||||
'comment': request.comment or 'Trading Platform',
|
||||
'comment': request.comment or 'OrbiQuant IA',
|
||||
'clientId': f'OQ_{int(time.time())}',
|
||||
'magic': request.magic,
|
||||
'slippage': self.config['risk']['max_slippage_pips']
|
||||
@ -478,7 +478,7 @@ class TradeManager:
|
||||
stop_loss=adjusted_sl,
|
||||
take_profit=adjusted_tp,
|
||||
options={
|
||||
'comment': request.comment or 'Trading Platform',
|
||||
'comment': request.comment or 'OrbiQuant IA',
|
||||
'clientId': f'OQ_{int(time.time())}',
|
||||
'magic': request.magic,
|
||||
'slippage': self.config['risk']['max_slippage_pips']
|
||||
@ -760,7 +760,7 @@ from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from typing import List, Optional
|
||||
|
||||
app = FastAPI(title="Trading Platform Trading Service")
|
||||
app = FastAPI(title="OrbiQuant Trading Service")
|
||||
|
||||
class TradeRequestModel(BaseModel):
|
||||
symbol: str
|
||||
@ -1056,14 +1056,14 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.trading
|
||||
container_name: trading-trading
|
||||
container_name: orbiquant-trading
|
||||
ports:
|
||||
- "3603:3603" # Trading service (base 3600 + 3)
|
||||
environment:
|
||||
- METAAPI_TOKEN=${METAAPI_TOKEN}
|
||||
- ML_ENGINE_URL=http://ml-engine:3601
|
||||
- REDIS_URL=redis://redis:6385
|
||||
- DATABASE_URL=postgresql://trading_user:trading_dev_2025@postgres:5438/trading_data
|
||||
- DATABASE_URL=postgresql://orbiquant_user:orbiquant_dev_2025@postgres:5438/orbiquant_trading
|
||||
volumes:
|
||||
- ./config:/app/config
|
||||
- ./logs:/app/logs
|
||||
@ -1163,4 +1163,4 @@ async def test_spread_too_high(trade_manager):
|
||||
---
|
||||
|
||||
**Documento Generado:** 2025-12-08
|
||||
**Trading Strategist - Trading Platform**
|
||||
**Trading Strategist - OrbiQuant IA**
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
---
|
||||
id: "INTEGRACION-TRADINGAGENT"
|
||||
title: "Integracion TradingAgent - Trading Platform"
|
||||
title: "Integracion TradingAgent - OrbiQuant IA"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Integración TradingAgent - Trading Platform
|
||||
# Integración TradingAgent - OrbiQuant IA
|
||||
|
||||
**Versión:** 1.0.0
|
||||
**Última actualización:** 2025-12-05
|
||||
@ -17,7 +17,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen
|
||||
|
||||
Este documento detalla el plan de integración del proyecto TradingAgent existente (`[LEGACY: apps/ml-engine - migrado desde TradingAgent]`) con la nueva plataforma Trading Platform. El objetivo es reutilizar los componentes ML ya desarrollados y probados.
|
||||
Este documento detalla el plan de integración del proyecto TradingAgent existente (`[LEGACY: apps/ml-engine - migrado desde TradingAgent]`) con la nueva plataforma OrbiQuant IA. El objetivo es reutilizar los componentes ML ya desarrollados y probados.
|
||||
|
||||
---
|
||||
|
||||
@ -84,7 +84,7 @@ ANTES (TradingAgent standalone):
|
||||
├── config/
|
||||
└── scripts/
|
||||
|
||||
DESPUÉS (Integrado en Trading Platform):
|
||||
DESPUÉS (Integrado en OrbiQuant):
|
||||
/home/isem/workspace/projects/trading-platform/
|
||||
├── apps/
|
||||
│ ├── frontend/ # React (nuevo)
|
||||
@ -119,7 +119,7 @@ async def get_prediction(symbol: str):
|
||||
}
|
||||
```
|
||||
|
||||
#### API Nueva (Trading Platform)
|
||||
#### API Nueva (OrbiQuant)
|
||||
|
||||
```python
|
||||
# apps/ml-engine/app/api/routers/predictions.py
|
||||
@ -311,7 +311,7 @@ export class SignalSubscriberService {
|
||||
|
||||
### Modelos ML
|
||||
|
||||
| TradingAgent | Trading Platform | Cambios Requeridos |
|
||||
| TradingAgent | OrbiQuant | Cambios Requeridos |
|
||||
|--------------|-----------|-------------------|
|
||||
| `XGBoostModel` | `RangePredictor` | Renombrar, agregar schemas |
|
||||
| `TPSLClassifier` | `TPSLClassifier` | Sin cambios |
|
||||
@ -322,7 +322,7 @@ export class SignalSubscriberService {
|
||||
### Features
|
||||
|
||||
```python
|
||||
# Mapeo de features TradingAgent → Trading Platform
|
||||
# Mapeo de features TradingAgent → OrbiQuant
|
||||
|
||||
FEATURE_MAPPING = {
|
||||
# Volatilidad
|
||||
@ -353,7 +353,7 @@ FEATURE_MAPPING = {
|
||||
|
||||
### Estrategias
|
||||
|
||||
| TradingAgent | Trading Platform Agent | Descripción |
|
||||
| TradingAgent | OrbiQuant Agent | Descripción |
|
||||
|--------------|-----------------|-------------|
|
||||
| AMD Accumulation | Atlas Entry | Entradas en acumulación |
|
||||
| AMD Distribution | Atlas Exit | Salidas en distribución |
|
||||
@ -377,7 +377,7 @@ API_PORT=8000
|
||||
API_KEY=your-ml-api-key
|
||||
|
||||
# Database (nuevo PostgreSQL)
|
||||
DATABASE_URL=postgresql://user:pass@postgres:5432/trading
|
||||
DATABASE_URL=postgresql://user:pass@postgres:5432/orbiquant
|
||||
LEGACY_MYSQL_URL=mysql://root:pass@72.60.226.4:3306/db_trading_meta
|
||||
|
||||
# Redis
|
||||
|
||||
@ -6,7 +6,7 @@ project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
created_date: "2026-01-04"
|
||||
updated_date: "2026-01-04"
|
||||
author: "Orquestador Agent - Trading Platform"
|
||||
author: "Orquestador Agent - OrbiQuant IA"
|
||||
---
|
||||
|
||||
# MCP Binance Connector - Especificacion Tecnica
|
||||
@ -1056,7 +1056,7 @@ app.get('/health', (req, res) => {
|
||||
|
||||
// MCP Server setup
|
||||
const server = new Server({
|
||||
name: 'trading-binance-mcp',
|
||||
name: 'orbiquant-binance-mcp',
|
||||
version: '1.0.0'
|
||||
}, {
|
||||
capabilities: {
|
||||
@ -1251,5 +1251,5 @@ describe('MCP Binance Connector API', () => {
|
||||
---
|
||||
|
||||
**Documento Generado:** 2026-01-04
|
||||
**Autor:** Orquestador Agent - Trading Platform
|
||||
**Autor:** Orquestador Agent - OrbiQuant IA
|
||||
**Version:** 1.0.0
|
||||
|
||||
@ -11,7 +11,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen Ejecutivo
|
||||
|
||||
La épica OQI-001 establece los fundamentos técnicos del proyecto Trading Platform, incluyendo un sistema de autenticación robusto y flexible que soporta múltiples métodos de acceso para maximizar la conversión de usuarios.
|
||||
La épica OQI-001 establece los fundamentos técnicos del proyecto OrbiQuant IA, incluyendo un sistema de autenticación robusto y flexible que soporta múltiples métodos de acceso para maximizar la conversión de usuarios.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen
|
||||
|
||||
Esta especificación detalla la implementación técnica del sistema de autenticación OAuth 2.0 multi-proveedor para Trading Platform.
|
||||
Esta especificación detalla la implementación técnica del sistema de autenticación OAuth 2.0 multi-proveedor para OrbiQuant IA.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen
|
||||
|
||||
Esta especificación detalla la implementación del sistema de tokens JWT para autenticación y autorización en Trading Platform.
|
||||
Esta especificación detalla la implementación del sistema de tokens JWT para autenticación y autorización en OrbiQuant IA.
|
||||
|
||||
---
|
||||
|
||||
@ -131,8 +131,8 @@ export class TokenService {
|
||||
{
|
||||
expiresIn: this.accessTokenExpiry,
|
||||
algorithm: 'RS256',
|
||||
issuer: 'trading.com',
|
||||
audience: 'trading.com',
|
||||
issuer: 'orbiquant.com',
|
||||
audience: 'orbiquant.com',
|
||||
}
|
||||
);
|
||||
|
||||
@ -147,7 +147,7 @@ export class TokenService {
|
||||
{
|
||||
expiresIn: this.refreshTokenExpiry,
|
||||
algorithm: 'RS256',
|
||||
issuer: 'trading.com',
|
||||
issuer: 'orbiquant.com',
|
||||
}
|
||||
);
|
||||
|
||||
@ -166,8 +166,8 @@ export class TokenService {
|
||||
try {
|
||||
const payload = jwt.verify(token, this.accessTokenSecret, {
|
||||
algorithms: ['RS256'],
|
||||
issuer: 'trading.com',
|
||||
audience: 'trading.com',
|
||||
issuer: 'orbiquant.com',
|
||||
audience: 'orbiquant.com',
|
||||
}) as TokenPayload;
|
||||
|
||||
return payload;
|
||||
@ -237,8 +237,8 @@ export class TokenService {
|
||||
"permissions": ["read:portfolio", "trade:paper", "read:education"],
|
||||
"iat": 1701792000,
|
||||
"exp": 1701792900,
|
||||
"iss": "trading.com",
|
||||
"aud": "trading.com"
|
||||
"iss": "orbiquant.com",
|
||||
"aud": "orbiquant.com"
|
||||
}
|
||||
```
|
||||
|
||||
@ -259,7 +259,7 @@ export class TokenService {
|
||||
"type": "refresh",
|
||||
"iat": 1701792000,
|
||||
"exp": 1702396800,
|
||||
"iss": "trading.com"
|
||||
"iss": "orbiquant.com"
|
||||
}
|
||||
```
|
||||
|
||||
@ -428,8 +428,8 @@ JWT_ACCESS_EXPIRY=15m
|
||||
JWT_REFRESH_EXPIRY=7d
|
||||
|
||||
# Issuer/Audience
|
||||
JWT_ISSUER=trading.com
|
||||
JWT_AUDIENCE=trading.com
|
||||
JWT_ISSUER=orbiquant.com
|
||||
JWT_AUDIENCE=orbiquant.com
|
||||
```
|
||||
|
||||
### Generación de Keys RS256
|
||||
|
||||
@ -21,7 +21,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen
|
||||
|
||||
Esta especificación detalla el esquema de base de datos para el sistema de autenticación de Trading Platform.
|
||||
Esta especificación detalla el esquema de base de datos para el sistema de autenticación de OrbiQuant IA.
|
||||
|
||||
---
|
||||
|
||||
@ -652,10 +652,10 @@ INSERT INTO users (
|
||||
email_verified
|
||||
) VALUES (
|
||||
'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
|
||||
'admin@trading.com',
|
||||
'admin@orbiquant.com',
|
||||
crypt('AdminPassword123!', gen_salt('bf', 12)),
|
||||
'Admin',
|
||||
'Trading Platform',
|
||||
'OrbiQuant',
|
||||
'superadmin',
|
||||
'active',
|
||||
TRUE
|
||||
|
||||
@ -21,14 +21,14 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen
|
||||
|
||||
Esta especificación detalla todos los endpoints de la API de autenticación de Trading Platform.
|
||||
Esta especificación detalla todos los endpoints de la API de autenticación de OrbiQuant IA.
|
||||
|
||||
---
|
||||
|
||||
## Base URL
|
||||
|
||||
```
|
||||
Production: https://api.trading.com/api/v1
|
||||
Production: https://api.orbiquant.com/api/v1
|
||||
Development: http://localhost:3000/api/v1
|
||||
```
|
||||
|
||||
@ -491,7 +491,7 @@ Authorization: Bearer {accessToken}
|
||||
"data": {
|
||||
"secret": "JBSWY3DPEHPK3PXP",
|
||||
"qrCode": "data:image/png;base64,iVBORw0KGgo...",
|
||||
"otpauthUrl": "otpauth://totp/Trading Platform:usuario@example.com?..."
|
||||
"otpauthUrl": "otpauth://totp/OrbiQuant:usuario@example.com?..."
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -821,4 +821,4 @@ X-RateLimit-Reset: 1701792060
|
||||
## Referencias
|
||||
|
||||
- [OpenAPI Spec](../../../98-standards/openapi/auth.yaml)
|
||||
- [Postman Collection](../../../96-quick-reference/postman/Trading Platform-Auth.json)
|
||||
- [Postman Collection](../../../96-quick-reference/postman/OrbiQuant-Auth.json)
|
||||
|
||||
@ -21,7 +21,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Resumen
|
||||
|
||||
Esta especificación detalla las medidas de seguridad implementadas en el sistema de autenticación de Trading Platform.
|
||||
Esta especificación detalla las medidas de seguridad implementadas en el sistema de autenticación de OrbiQuant IA.
|
||||
|
||||
---
|
||||
|
||||
@ -295,7 +295,7 @@ export const securityHeaders = helmet({
|
||||
scriptSrc: ["'self'", "'unsafe-inline'"], // Para OAuth popups
|
||||
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||
imgSrc: ["'self'", 'data:', 'https:'],
|
||||
connectSrc: ["'self'", 'https://api.trading.com'],
|
||||
connectSrc: ["'self'", 'https://api.orbiquant.com'],
|
||||
fontSrc: ["'self'", 'https://fonts.gstatic.com'],
|
||||
objectSrc: ["'none'"],
|
||||
mediaSrc: ["'self'"],
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** visitante de Trading Platform
|
||||
**Como** visitante de OrbiQuant
|
||||
**Quiero** poder crear una cuenta usando mi email y contraseña
|
||||
**Para** acceder a las funcionalidades de la plataforma
|
||||
|
||||
@ -87,7 +87,7 @@ updated_date: "2026-01-04"
|
||||
**Dado** que me registré exitosamente
|
||||
**Cuando** reviso mi email
|
||||
**Entonces** debería recibir un email con:
|
||||
- Asunto: "Verifica tu cuenta de Trading Platform"
|
||||
- Asunto: "Verifica tu cuenta de OrbiQuant"
|
||||
- Un link de verificación válido por 24 horas
|
||||
- Instrucciones claras
|
||||
|
||||
@ -106,7 +106,7 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ 🌟 Crea tu cuenta en Trading Platform │
|
||||
│ 🌟 Crea tu cuenta en OrbiQuant │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ Email │ │
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario registrado de Trading Platform
|
||||
**Como** usuario registrado de OrbiQuant
|
||||
**Quiero** iniciar sesión con mi email y contraseña
|
||||
**Para** acceder a mi cuenta y utilizar la plataforma
|
||||
|
||||
@ -107,7 +107,7 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ 🌟 Inicia sesión en Trading Platform │
|
||||
│ 🌟 Inicia sesión en OrbiQuant │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ Email │ │
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** visitante de Trading Platform
|
||||
**Como** visitante de OrbiQuant
|
||||
**Quiero** poder iniciar sesión con mi cuenta de Google
|
||||
**Para** acceder rápidamente sin crear nuevas credenciales
|
||||
|
||||
@ -46,7 +46,7 @@ updated_date: "2026-01-04"
|
||||
### AC-003: Autorización exitosa (usuario nuevo)
|
||||
|
||||
**Dado** que autorizo el acceso en Google
|
||||
**Y** mi email de Google no está registrado en Trading Platform
|
||||
**Y** mi email de Google no está registrado en OrbiQuant
|
||||
**Cuando** Google me redirige de vuelta
|
||||
**Entonces** debería:
|
||||
1. Crear una nueva cuenta automáticamente
|
||||
@ -58,7 +58,7 @@ updated_date: "2026-01-04"
|
||||
### AC-004: Autorización exitosa (usuario existente)
|
||||
|
||||
**Dado** que autorizo el acceso en Google
|
||||
**Y** mi email de Google ya está registrado en Trading Platform
|
||||
**Y** mi email de Google ya está registrado en OrbiQuant
|
||||
**Cuando** Google me redirige de vuelta
|
||||
**Entonces** debería:
|
||||
1. Vincular Google a mi cuenta existente
|
||||
@ -105,7 +105,7 @@ updated_date: "2026-01-04"
|
||||
│ │
|
||||
│ ┌────────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ │ │
|
||||
│ │ Inicia sesión en Trading Platform │ │
|
||||
│ │ Inicia sesión en OrbiQuant │ │
|
||||
│ │ │ │
|
||||
│ │ ┌──────────────────────────────────────────────────────────────┐│ │
|
||||
│ │ │ 🔵 Continuar con Google → ││ │
|
||||
@ -121,9 +121,9 @@ updated_date: "2026-01-04"
|
||||
│ │ ┌────────────────────────────────────────────────────────────┐ │ │
|
||||
│ │ │ Google │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ Trading Platform quiere acceder a tu cuenta de Google │ │ │
|
||||
│ │ │ OrbiQuant IA quiere acceder a tu cuenta de Google │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ Esto permitirá a Trading Platform: │ │ │
|
||||
│ │ │ Esto permitirá a OrbiQuant IA: │ │ │
|
||||
│ │ │ • Ver tu dirección de correo electrónico │ │ │
|
||||
│ │ │ • Ver tu información personal básica │ │ │
|
||||
│ │ │ │ │ │
|
||||
@ -190,7 +190,7 @@ updated_date: "2026-01-04"
|
||||
```env
|
||||
GOOGLE_CLIENT_ID=xxx.apps.googleusercontent.com
|
||||
GOOGLE_CLIENT_SECRET=xxx
|
||||
GOOGLE_CALLBACK_URL=https://api.trading.com/auth/oauth/google/callback
|
||||
GOOGLE_CALLBACK_URL=https://api.orbiquant.com/auth/oauth/google/callback
|
||||
```
|
||||
|
||||
### Scopes Solicitados
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** visitante o usuario de Trading Platform
|
||||
**Como** visitante o usuario de OrbiQuant
|
||||
**Quiero** poder registrarme e iniciar sesión usando mi cuenta de Facebook
|
||||
**Para** tener un acceso rápido y sencillo sin crear una nueva contraseña
|
||||
|
||||
@ -108,7 +108,7 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ 🌟 Bienvenido a Trading Platform │
|
||||
│ 🌟 Bienvenido a OrbiQuant │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ 📧 Email │ │
|
||||
@ -131,7 +131,7 @@ Ventana de Facebook OAuth:
|
||||
│ facebook.com ✕ │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ Trading Platform desea acceder a: │
|
||||
│ OrbiQuant desea acceder a: │
|
||||
│ │
|
||||
│ ✓ Tu nombre y foto de perfil │
|
||||
│ ✓ Tu dirección de email │
|
||||
@ -282,7 +282,7 @@ Ventana de Facebook OAuth:
|
||||
```env
|
||||
FACEBOOK_APP_ID=your_app_id
|
||||
FACEBOOK_APP_SECRET=your_app_secret
|
||||
FACEBOOK_CALLBACK_URL=https://trading.com/api/v1/auth/facebook/callback
|
||||
FACEBOOK_CALLBACK_URL=https://orbiquant.com/api/v1/auth/facebook/callback
|
||||
```
|
||||
|
||||
### Security Considerations
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** visitante o usuario de Trading Platform
|
||||
**Como** visitante o usuario de OrbiQuant
|
||||
**Quiero** poder registrarme e iniciar sesión usando mi cuenta de Twitter/X
|
||||
**Para** tener un acceso rápido sin crear una nueva contraseña
|
||||
|
||||
@ -104,7 +104,7 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ 🌟 Bienvenido a Trading Platform │
|
||||
│ 🌟 Bienvenido a OrbiQuant │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ 📧 Email │ │
|
||||
@ -127,7 +127,7 @@ Ventana de X OAuth:
|
||||
│ x.com ✕ │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ Autorizar Trading Platform │
|
||||
│ Autorizar OrbiQuant │
|
||||
│ │
|
||||
│ Esta aplicación podrá: │
|
||||
│ │
|
||||
@ -297,7 +297,7 @@ Formulario adicional si falta email:
|
||||
```env
|
||||
TWITTER_CLIENT_ID=your_client_id
|
||||
TWITTER_CLIENT_SECRET=your_client_secret
|
||||
TWITTER_CALLBACK_URL=https://trading.com/api/v1/auth/twitter/callback
|
||||
TWITTER_CALLBACK_URL=https://orbiquant.com/api/v1/auth/twitter/callback
|
||||
```
|
||||
|
||||
### Consideraciones Especiales de X
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** visitante o usuario de Trading Platform
|
||||
**Como** visitante o usuario de OrbiQuant
|
||||
**Quiero** poder registrarme e iniciar sesión usando Apple Sign In
|
||||
**Para** tener un acceso seguro y privado sin compartir mi email real
|
||||
|
||||
@ -107,7 +107,7 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ 🌟 Bienvenido a Trading Platform │
|
||||
│ 🌟 Bienvenido a OrbiQuant │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ 📧 Email │ │
|
||||
@ -133,7 +133,7 @@ Ventana de Apple Sign In:
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ "Trading Platform" desea usar tu Apple ID para iniciar sesión │
|
||||
│ "OrbiQuant" desea usar tu Apple ID para iniciar sesión │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ Nombre │ │
|
||||
@ -149,7 +149,7 @@ Ventana de Apple Sign In:
|
||||
│ └─────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ Tu información será compartida según las políticas de │
|
||||
│ privacidad de Trading Platform. │
|
||||
│ privacidad de OrbiQuant. │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ Continuar con Touch ID │ │
|
||||
@ -288,7 +288,7 @@ Ventana de Apple Sign In:
|
||||
```json
|
||||
{
|
||||
"iss": "https://appleid.apple.com",
|
||||
"aud": "com.trading.service",
|
||||
"aud": "com.orbiquant.service",
|
||||
"exp": 1234567890,
|
||||
"iat": 1234567890,
|
||||
"sub": "001234.abc123...", // Apple User ID
|
||||
@ -302,11 +302,11 @@ Ventana de Apple Sign In:
|
||||
### Environment Variables
|
||||
|
||||
```env
|
||||
APPLE_SERVICE_ID=com.trading.service
|
||||
APPLE_SERVICE_ID=com.orbiquant.service
|
||||
APPLE_TEAM_ID=ABC123XYZ
|
||||
APPLE_KEY_ID=KEY123
|
||||
APPLE_PRIVATE_KEY_PATH=/path/to/AuthKey_KEY123.p8
|
||||
APPLE_CALLBACK_URL=https://trading.com/api/v1/auth/apple/callback
|
||||
APPLE_CALLBACK_URL=https://orbiquant.com/api/v1/auth/apple/callback
|
||||
```
|
||||
|
||||
### Consideraciones Especiales de Apple
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** desarrollador o usuario técnico de Trading Platform
|
||||
**Como** desarrollador o usuario técnico de OrbiQuant
|
||||
**Quiero** poder registrarme e iniciar sesión usando mi cuenta de GitHub
|
||||
**Para** tener un acceso rápido usando mis credenciales de desarrollador
|
||||
|
||||
@ -102,7 +102,7 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ 🌟 Bienvenido a Trading Platform │
|
||||
│ 🌟 Bienvenido a OrbiQuant │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ 📧 Email │ │
|
||||
@ -125,9 +125,9 @@ Ventana de GitHub OAuth:
|
||||
│ github.com ✕ │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ Authorize Trading Platform │
|
||||
│ Authorize OrbiQuant │
|
||||
│ │
|
||||
│ Trading Platform by Trading Platform Team │
|
||||
│ OrbiQuant by OrbiQuant Team │
|
||||
│ wants to access your juanperez account │
|
||||
│ │
|
||||
│ This application will be able to: │
|
||||
@ -137,10 +137,10 @@ Ventana de GitHub OAuth:
|
||||
│ ✓ Read your profile information │
|
||||
│ │
|
||||
│ Authorizing will redirect to: │
|
||||
│ https://trading.com/api/v1/auth/github/callback │
|
||||
│ https://orbiquant.com/api/v1/auth/github/callback │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ Authorize Trading Platform │ │
|
||||
│ │ Authorize OrbiQuant │ │
|
||||
│ └─────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ Cancel │
|
||||
@ -286,7 +286,7 @@ Ventana de GitHub OAuth:
|
||||
```env
|
||||
GITHUB_CLIENT_ID=your_client_id
|
||||
GITHUB_CLIENT_SECRET=your_client_secret
|
||||
GITHUB_CALLBACK_URL=https://trading.com/api/v1/auth/github/callback
|
||||
GITHUB_CALLBACK_URL=https://orbiquant.com/api/v1/auth/github/callback
|
||||
```
|
||||
|
||||
### Consideraciones Especiales de GitHub
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform
|
||||
**Como** usuario de OrbiQuant
|
||||
**Quiero** poder registrarme e iniciar sesión usando mi número de teléfono y un código SMS
|
||||
**Para** tener un acceso rápido sin necesidad de recordar contraseñas
|
||||
|
||||
@ -64,7 +64,7 @@ updated_date: "2026-01-04"
|
||||
**Cuando** recibo el SMS
|
||||
**Entonces** debería tener el formato:
|
||||
```
|
||||
Tu código de Trading Platform es: 123456
|
||||
Tu código de OrbiQuant es: 123456
|
||||
|
||||
Válido por 10 minutos.
|
||||
No compartas este código.
|
||||
@ -384,7 +384,7 @@ const client = twilio(accountSid, authToken);
|
||||
|
||||
// Enviar SMS
|
||||
await client.messages.create({
|
||||
body: `Tu código de Trading Platform es: ${code}\n\nVálido por 10 minutos.`,
|
||||
body: `Tu código de OrbiQuant es: ${code}\n\nVálido por 10 minutos.`,
|
||||
from: twilioPhoneNumber,
|
||||
to: userPhoneNumber
|
||||
});
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform
|
||||
**Como** usuario de OrbiQuant
|
||||
**Quiero** poder registrarme e iniciar sesión recibiendo el código por WhatsApp
|
||||
**Para** usar una aplicación que ya tengo instalada y me resulta más familiar que SMS
|
||||
|
||||
@ -57,14 +57,14 @@ updated_date: "2026-01-04"
|
||||
```
|
||||
¡Hola! 👋
|
||||
|
||||
Tu código de verificación de Trading Platform es:
|
||||
Tu código de verificación de OrbiQuant es:
|
||||
|
||||
*123456*
|
||||
|
||||
Válido por 10 minutos.
|
||||
No compartas este código con nadie.
|
||||
|
||||
Trading Platform - Inversiones Inteligentes
|
||||
OrbiQuant - Inversiones Inteligentes
|
||||
```
|
||||
|
||||
### AC-004: Código recibido
|
||||
@ -137,19 +137,19 @@ Mensaje de WhatsApp:
|
||||
│ WhatsApp 🔍 ⋮ │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ◀ Trading Platform ✓✓ │
|
||||
│ ◀ OrbiQuant ✓✓ │
|
||||
│ │
|
||||
│ ┌──────────────────────────────────────────────────────┐ │
|
||||
│ │ ¡Hola! 👋 │ │
|
||||
│ │ │ │
|
||||
│ │ Tu código de verificación de Trading Platform es: │ │
|
||||
│ │ Tu código de verificación de OrbiQuant es: │ │
|
||||
│ │ │ │
|
||||
│ │ *123456* │ │
|
||||
│ │ │ │
|
||||
│ │ Válido por 10 minutos. │ │
|
||||
│ │ No compartas este código con nadie. │ │
|
||||
│ │ │ │
|
||||
│ │ Trading Platform - Inversiones Inteligentes │ │
|
||||
│ │ OrbiQuant - Inversiones Inteligentes │ │
|
||||
│ └──────────────────────────────────────────────────────┘ │
|
||||
│ 15:42 │
|
||||
│ │
|
||||
@ -297,7 +297,7 @@ const hasWhatsApp = lookup.lineTypeIntelligence?.type === 'whatsapp';
|
||||
|
||||
// Enviar mensaje por WhatsApp
|
||||
await client.messages.create({
|
||||
body: `¡Hola! 👋\n\nTu código de verificación de Trading Platform es:\n\n*${code}*\n\nVálido por 10 minutos.\nNo compartas este código con nadie.\n\nTrading Platform - Inversiones Inteligentes`,
|
||||
body: `¡Hola! 👋\n\nTu código de verificación de OrbiQuant es:\n\n*${code}*\n\nVálido por 10 minutos.\nNo compartas este código con nadie.\n\nOrbiQuant - Inversiones Inteligentes`,
|
||||
from: 'whatsapp:+14155238886', // Twilio WhatsApp number
|
||||
to: `whatsapp:${phoneNumber}`
|
||||
});
|
||||
@ -340,14 +340,14 @@ Language: es
|
||||
Body:
|
||||
¡Hola! 👋
|
||||
|
||||
Tu código de verificación de Trading Platform es:
|
||||
Tu código de verificación de OrbiQuant es:
|
||||
|
||||
*{{1}}*
|
||||
|
||||
Válido por 10 minutos.
|
||||
No compartas este código con nadie.
|
||||
|
||||
Trading Platform - Inversiones Inteligentes
|
||||
OrbiQuant - Inversiones Inteligentes
|
||||
```
|
||||
|
||||
### Fallback Strategy
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform
|
||||
**Como** usuario de OrbiQuant
|
||||
**Quiero** poder activar autenticación de dos factores
|
||||
**Para** proteger mi cuenta con una capa adicional de seguridad
|
||||
|
||||
@ -270,8 +270,8 @@ import speakeasy from 'speakeasy';
|
||||
// Generar secreto
|
||||
const secret = speakeasy.generateSecret({
|
||||
length: 20,
|
||||
name: `Trading Platform:${user.email}`,
|
||||
issuer: 'Trading Platform',
|
||||
name: `OrbiQuant:${user.email}`,
|
||||
issuer: 'OrbiQuant IA',
|
||||
});
|
||||
|
||||
// Verificar código
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform que olvidó su contraseña
|
||||
**Como** usuario de OrbiQuant que olvidó su contraseña
|
||||
**Quiero** poder recuperar el acceso a mi cuenta
|
||||
**Para** poder volver a iniciar sesión sin necesidad de crear una nueva cuenta
|
||||
|
||||
@ -76,7 +76,7 @@ updated_date: "2026-01-04"
|
||||
**Dado** que solicité recuperación de contraseña
|
||||
**Cuando** reviso mi email
|
||||
**Entonces** debería recibir un email con:
|
||||
- Asunto: "Recupera tu contraseña de Trading Platform"
|
||||
- Asunto: "Recupera tu contraseña de OrbiQuant"
|
||||
- Saludo personalizado con mi nombre
|
||||
- Explicación clara del proceso
|
||||
- Botón/link de "Restablecer contraseña"
|
||||
@ -207,9 +207,9 @@ Paso 2: Confirmación
|
||||
Email de recuperación:
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ De: Trading Platform <noreply@trading.com> │
|
||||
│ De: OrbiQuant <noreply@orbiquant.com> │
|
||||
│ Para: usuario@example.com │
|
||||
│ Asunto: Recupera tu contraseña de Trading Platform │
|
||||
│ Asunto: Recupera tu contraseña de OrbiQuant │
|
||||
│ │
|
||||
│ ───────────────────────────────────────────────────── │
|
||||
│ │
|
||||
@ -224,7 +224,7 @@ Email de recuperación:
|
||||
│ └─────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ O copia este link en tu navegador: │
|
||||
│ https://trading.com/reset-password?token=abc123... │
|
||||
│ https://orbiquant.com/reset-password?token=abc123... │
|
||||
│ │
|
||||
│ Este link expirará en 1 hora. │
|
||||
│ │
|
||||
@ -232,7 +232,7 @@ Email de recuperación:
|
||||
│ email. Tu contraseña no cambiará. │
|
||||
│ │
|
||||
│ Saludos, │
|
||||
│ El equipo de Trading Platform │
|
||||
│ El equipo de OrbiQuant │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
|
||||
@ -470,7 +470,7 @@ const hashedToken = crypto
|
||||
PASSWORD_RESET_TOKEN_EXPIRY=3600 # 1 hora en segundos
|
||||
PASSWORD_RESET_RATE_LIMIT=3 # intentos por ventana
|
||||
PASSWORD_RESET_RATE_WINDOW=3600 # 1 hora
|
||||
FRONTEND_URL=https://trading.com
|
||||
FRONTEND_URL=https://orbiquant.com
|
||||
```
|
||||
|
||||
### Security Best Practices
|
||||
|
||||
@ -23,7 +23,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform
|
||||
**Como** usuario de OrbiQuant
|
||||
**Quiero** poder ver y gestionar mis sesiones activas en diferentes dispositivos
|
||||
**Para** tener control sobre dónde está abierta mi cuenta y poder cerrar sesiones remotamente por seguridad
|
||||
|
||||
@ -242,7 +242,7 @@ Modal de confirmación:
|
||||
|
||||
Email de nueva sesión:
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ De: Trading Platform Security <security@trading.com> │
|
||||
│ De: OrbiQuant Security <security@orbiquant.com> │
|
||||
│ Asunto: Nueva sesión iniciada en tu cuenta │
|
||||
│ │
|
||||
│ Hola Juan, │
|
||||
|
||||
@ -259,7 +259,7 @@ TWITTER_CLIENT_ID=xxx
|
||||
TWITTER_CLIENT_SECRET=xxx
|
||||
|
||||
# Apple OAuth
|
||||
APPLE_CLIENT_ID=com.trading.auth
|
||||
APPLE_CLIENT_ID=com.orbiquant.auth
|
||||
APPLE_TEAM_ID=xxx
|
||||
APPLE_KEY_ID=xxx
|
||||
APPLE_PRIVATE_KEY=xxx
|
||||
@ -269,8 +269,8 @@ GITHUB_CLIENT_ID=xxx
|
||||
GITHUB_CLIENT_SECRET=xxx
|
||||
|
||||
# Callback URLs
|
||||
OAUTH_CALLBACK_URL=https://api.trading.com/auth/oauth/callback
|
||||
FRONTEND_URL=https://app.trading.com
|
||||
OAUTH_CALLBACK_URL=https://api.orbiquant.com/auth/oauth/callback
|
||||
FRONTEND_URL=https://app.orbiquant.com
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -239,11 +239,11 @@ Usuario Frontend Backend
|
||||
### Verificación de Email
|
||||
|
||||
```html
|
||||
Asunto: Verifica tu cuenta de Trading Platform
|
||||
Asunto: Verifica tu cuenta de OrbiQuant
|
||||
|
||||
Hola {{firstName}},
|
||||
|
||||
Gracias por registrarte en Trading Platform.
|
||||
Gracias por registrarte en OrbiQuant IA.
|
||||
|
||||
Para completar tu registro, verifica tu email haciendo click aquí:
|
||||
{{verificationUrl}}
|
||||
@ -253,13 +253,13 @@ Este link expira en 24 horas.
|
||||
Si no creaste esta cuenta, ignora este email.
|
||||
|
||||
Saludos,
|
||||
Equipo Trading Platform
|
||||
Equipo OrbiQuant
|
||||
```
|
||||
|
||||
### Recuperación de Contraseña
|
||||
|
||||
```html
|
||||
Asunto: Recupera tu contraseña de Trading Platform
|
||||
Asunto: Recupera tu contraseña de OrbiQuant
|
||||
|
||||
Hola {{firstName}},
|
||||
|
||||
@ -274,7 +274,7 @@ Si no solicitaste este cambio, ignora este email.
|
||||
Tu contraseña actual seguirá funcionando.
|
||||
|
||||
Saludos,
|
||||
Equipo Trading Platform
|
||||
Equipo OrbiQuant
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -190,13 +190,13 @@ await redis.setEx(key, 300, JSON.stringify(otpData));
|
||||
### SMS
|
||||
|
||||
```
|
||||
Trading Platform: Tu código de verificación es 123456. Expira en 5 minutos.
|
||||
OrbiQuant: Tu código de verificación es 123456. Expira en 5 minutos.
|
||||
```
|
||||
|
||||
### WhatsApp
|
||||
|
||||
```
|
||||
🔐 *Trading Platform*
|
||||
🔐 *OrbiQuant IA*
|
||||
|
||||
Tu código de verificación es: *123456*
|
||||
|
||||
@ -253,7 +253,7 @@ TWILIO_WHATSAPP_NUMBER=+14155238886
|
||||
|
||||
```typescript
|
||||
await twilioClient.messages.create({
|
||||
body: `Trading Platform: Tu código es ${otp}. Expira en 5 min.`,
|
||||
body: `OrbiQuant: Tu código es ${otp}. Expira en 5 min.`,
|
||||
from: process.env.TWILIO_PHONE_NUMBER,
|
||||
to: phone,
|
||||
});
|
||||
@ -263,7 +263,7 @@ await twilioClient.messages.create({
|
||||
|
||||
```typescript
|
||||
await twilioClient.messages.create({
|
||||
body: `🔐 *Trading Platform*\n\nTu código es: *${otp}*\n\nExpira en 5 minutos.`,
|
||||
body: `🔐 *OrbiQuant IA*\n\nTu código es: *${otp}*\n\nExpira en 5 minutos.`,
|
||||
from: `whatsapp:${process.env.TWILIO_WHATSAPP_NUMBER}`,
|
||||
to: `whatsapp:${phone}`,
|
||||
});
|
||||
|
||||
@ -91,8 +91,8 @@ import speakeasy from 'speakeasy';
|
||||
|
||||
const secret = speakeasy.generateSecret({
|
||||
length: 20,
|
||||
name: 'Trading Platform',
|
||||
issuer: 'Trading Platform',
|
||||
name: 'OrbiQuant IA',
|
||||
issuer: 'OrbiQuant',
|
||||
});
|
||||
|
||||
// secret.base32 → almacenar encriptado
|
||||
@ -314,7 +314,7 @@ await db.query(`
|
||||
### 2FA Activado
|
||||
|
||||
```
|
||||
Asunto: 2FA activado en tu cuenta Trading Platform
|
||||
Asunto: 2FA activado en tu cuenta OrbiQuant
|
||||
|
||||
Hola {{firstName}},
|
||||
|
||||
@ -327,7 +327,7 @@ IP: {{ip}}
|
||||
Si no realizaste esta acción, contacta soporte inmediatamente.
|
||||
|
||||
Saludos,
|
||||
Equipo Trading Platform
|
||||
Equipo OrbiQuant
|
||||
```
|
||||
|
||||
### Backup Code Usado
|
||||
@ -347,7 +347,7 @@ Códigos restantes: {{remainingCodes}}
|
||||
Si no fuiste tú, cambia tu contraseña y contacta soporte.
|
||||
|
||||
Saludos,
|
||||
Equipo Trading Platform
|
||||
Equipo OrbiQuant
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -317,7 +317,7 @@ Response 200:
|
||||
### Email de Nuevo Dispositivo
|
||||
|
||||
```
|
||||
Asunto: Nuevo inicio de sesión en tu cuenta Trading Platform
|
||||
Asunto: Nuevo inicio de sesión en tu cuenta OrbiQuant
|
||||
|
||||
Hola {{firstName}},
|
||||
|
||||
@ -338,7 +338,7 @@ Si NO fuiste tú:
|
||||
[Asegurar mi cuenta]
|
||||
|
||||
Saludos,
|
||||
Equipo Trading Platform
|
||||
Equipo OrbiQuant
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -16,7 +16,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Propósito
|
||||
|
||||
Esta épica implementa la plataforma educativa de Trading Platform, permitiendo a los usuarios aprender trading a través de cursos estructurados con video, texto, quizzes y sistema de progreso con gamificación.
|
||||
Esta épica implementa la plataforma educativa de OrbiQuant IA, permitiendo a los usuarios aprender trading a través de cursos estructurados con video, texto, quizzes y sistema de progreso con gamificación.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Descripción
|
||||
|
||||
Define el modelo de datos completo para el módulo educativo de Trading Platform, implementado en PostgreSQL 15+ bajo el schema `education`. Incluye todas las entidades necesarias para gestionar cursos, lecciones, progreso de estudiantes, evaluaciones, certificaciones y gamificación.
|
||||
Define el modelo de datos completo para el módulo educativo de OrbiQuant IA, implementado en PostgreSQL 15+ bajo el schema `education`. Incluye todas las entidades necesarias para gestionar cursos, lecciones, progreso de estudiantes, evaluaciones, certificaciones y gamificación.
|
||||
|
||||
---
|
||||
|
||||
@ -827,7 +827,7 @@ Interfaces TypeScript generadas automáticamente desde el schema usando Prisma o
|
||||
|
||||
```bash
|
||||
# PostgreSQL
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/trading
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/orbiquant
|
||||
DATABASE_SCHEMA=education
|
||||
DATABASE_POOL_MIN=2
|
||||
DATABASE_POOL_MAX=10
|
||||
|
||||
@ -21,7 +21,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Descripción
|
||||
|
||||
Define todos los endpoints REST del módulo educativo de Trading Platform, implementados en Express.js con TypeScript. Incluye autenticación JWT, validación de datos, paginación, filtros y manejo de errores.
|
||||
Define todos los endpoints REST del módulo educativo de OrbiQuant IA, implementados en Express.js con TypeScript. Incluye autenticación JWT, validación de datos, paginación, filtros y manejo de errores.
|
||||
|
||||
---
|
||||
|
||||
@ -73,7 +73,7 @@ Define todos los endpoints REST del módulo educativo de Trading Platform, imple
|
||||
### Base URL
|
||||
|
||||
```
|
||||
Production: https://api.trading.ai/v1/education
|
||||
Production: https://api.orbiquant.ai/v1/education
|
||||
Development: http://localhost:3000/v1/education
|
||||
```
|
||||
|
||||
@ -1551,7 +1551,7 @@ PORT=3000
|
||||
NODE_ENV=production
|
||||
|
||||
# Database
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/trading
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/orbiquant
|
||||
DATABASE_SCHEMA=education
|
||||
|
||||
# JWT
|
||||
@ -1564,13 +1564,13 @@ RATE_LIMIT_MAX_REQUESTS=100
|
||||
RATE_LIMIT_AUTHENTICATED_MAX=1000
|
||||
|
||||
# CORS
|
||||
CORS_ORIGIN=https://trading.ai,https://app.trading.ai
|
||||
CORS_ORIGIN=https://orbiquant.ai,https://app.orbiquant.ai
|
||||
CORS_CREDENTIALS=true
|
||||
|
||||
# External Services
|
||||
VIMEO_API_KEY=xxx
|
||||
AWS_S3_BUCKET=trading-videos
|
||||
AWS_CLOUDFRONT_URL=https://cdn.trading.ai
|
||||
AWS_S3_BUCKET=orbiquant-videos
|
||||
AWS_CLOUDFRONT_URL=https://cdn.orbiquant.ai
|
||||
|
||||
# Email (para certificados)
|
||||
SMTP_HOST=smtp.sendgrid.net
|
||||
|
||||
@ -1256,11 +1256,11 @@ Ver archivo: `/src/types/index.ts`
|
||||
|
||||
```bash
|
||||
# API
|
||||
VITE_API_URL=https://api.trading.ai/v1
|
||||
VITE_API_URL=https://api.orbiquant.ai/v1
|
||||
VITE_API_TIMEOUT=30000
|
||||
|
||||
# CDN
|
||||
VITE_CDN_URL=https://cdn.trading.ai
|
||||
VITE_CDN_URL=https://cdn.orbiquant.ai
|
||||
VITE_VIMEO_PLAYER_ID=xxxxx
|
||||
|
||||
# Features
|
||||
|
||||
@ -321,7 +321,7 @@ export const VimeoPlayer: React.FC<VimeoPlayerProps> = ({
|
||||
|
||||
```yaml
|
||||
Bucket Configuration:
|
||||
Name: trading-videos-prod
|
||||
Name: orbiquant-videos-prod
|
||||
Region: us-east-1
|
||||
Versioning: Enabled
|
||||
Encryption: AES-256 (SSE-S3)
|
||||
@ -358,18 +358,18 @@ Folder Structure:
|
||||
export const cloudFrontConfig = {
|
||||
distribution: {
|
||||
enabled: true,
|
||||
comment: 'Trading Platform Video CDN',
|
||||
comment: 'OrbiQuant Video CDN',
|
||||
origins: [
|
||||
{
|
||||
id: 'S3-trading-videos',
|
||||
domainName: 'trading-videos-prod.s3.amazonaws.com',
|
||||
id: 'S3-orbiquant-videos',
|
||||
domainName: 'orbiquant-videos-prod.s3.amazonaws.com',
|
||||
s3OriginConfig: {
|
||||
originAccessIdentity: 'origin-access-identity/cloudfront/XXXXX'
|
||||
}
|
||||
}
|
||||
],
|
||||
defaultCacheBehavior: {
|
||||
targetOriginId: 'S3-trading-videos',
|
||||
targetOriginId: 'S3-orbiquant-videos',
|
||||
viewerProtocolPolicy: 'redirect-to-https',
|
||||
allowedMethods: ['GET', 'HEAD', 'OPTIONS'],
|
||||
cachedMethods: ['GET', 'HEAD'],
|
||||
@ -967,7 +967,7 @@ VIMEO_ACCESS_TOKEN=xxxxx
|
||||
AWS_ACCESS_KEY_ID=xxxxx
|
||||
AWS_SECRET_ACCESS_KEY=xxxxx
|
||||
AWS_REGION=us-east-1
|
||||
AWS_S3_BUCKET=trading-videos-prod
|
||||
AWS_S3_BUCKET=orbiquant-videos-prod
|
||||
|
||||
# CloudFront
|
||||
CLOUDFRONT_DOMAIN=d1234abcd.cloudfront.net
|
||||
@ -1017,8 +1017,8 @@ VIDEO_DEFAULT_QUALITY=720p
|
||||
```typescript
|
||||
// Para Vimeo
|
||||
const allowedDomains = [
|
||||
'trading.ai',
|
||||
'app.trading.ai',
|
||||
'orbiquant.ai',
|
||||
'app.orbiquant.ai',
|
||||
'localhost:3000' // Solo dev
|
||||
];
|
||||
```
|
||||
@ -1060,7 +1060,7 @@ ffmpeg(inputPath)
|
||||
import loadtest from 'loadtest';
|
||||
|
||||
const options = {
|
||||
url: 'https://api.trading.ai/v1/education/lessons/xxx/video-url',
|
||||
url: 'https://api.orbiquant.ai/v1/education/lessons/xxx/video-url',
|
||||
maxRequests: 1000,
|
||||
concurrency: 100,
|
||||
headers: {
|
||||
|
||||
@ -9,7 +9,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
# Especificaciones Técnicas - OQI-002 Módulo Educativo
|
||||
|
||||
Este directorio contiene las especificaciones técnicas detalladas para el módulo educativo de Trading Platform.
|
||||
Este directorio contiene las especificaciones técnicas detalladas para el módulo educativo de OrbiQuant IA.
|
||||
|
||||
## Índice de Especificaciones
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ El usuario debe poder acceder a una página que muestre todos los cursos educati
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ [LOGO] Trading Platform Educación Trading Cuentas 👤 │
|
||||
│ [LOGO] OrbiQuant IA Educación Trading Cuentas 👤 │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ CATÁLOGO DE CURSOS [🔍 Buscar cursos...] │
|
||||
@ -240,7 +240,7 @@ Y los filtros activos se mantienen
|
||||
title: "Fibonacci Retracement Básico",
|
||||
slug: "fibonacci-retracement-basico",
|
||||
shortDescription: "Aprende a usar Fibonacci...",
|
||||
thumbnail: "https://cdn.trading.com/courses/fib.jpg",
|
||||
thumbnail: "https://cdn.orbiquant.com/courses/fib.jpg",
|
||||
category: {
|
||||
id: "cat-1",
|
||||
name: "Análisis Técnico",
|
||||
|
||||
@ -41,7 +41,7 @@ El usuario debe poder acceder a un dashboard educativo centralizado que muestre
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ [LOGO] Trading Platform Educación Trading Cuentas 👤 │
|
||||
│ [LOGO] OrbiQuant IA Educación Trading Cuentas 👤 │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ MI APRENDIZAJE │
|
||||
|
||||
@ -35,7 +35,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Descripción Detallada
|
||||
|
||||
El usuario debe recibir automáticamente un certificado digital en formato PDF al completar el 100% de un curso. El certificado debe tener diseño profesional con logo de Trading Platform, nombre del usuario, título del curso, fecha de finalización, ID único de verificación, y QR code. El usuario debe poder descargar el PDF, compartir en LinkedIn, y el certificado debe ser verificable públicamente.
|
||||
El usuario debe recibir automáticamente un certificado digital en formato PDF al completar el 100% de un curso. El certificado debe tener diseño profesional con logo de OrbiQuant, nombre del usuario, título del curso, fecha de finalización, ID único de verificación, y QR code. El usuario debe poder descargar el PDF, compartir en LinkedIn, y el certificado debe ser verificable públicamente.
|
||||
|
||||
## Mockups/Wireframes
|
||||
|
||||
@ -103,7 +103,7 @@ El usuario debe recibir automáticamente un certificado digital en formato PDF a
|
||||
|
||||
[PÁGINA DE VERIFICACIÓN PÚBLICA]
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ [LOGO] Trading Platform │
|
||||
│ [LOGO] OrbiQuant IA │
|
||||
│ │
|
||||
│ VERIFICACIÓN DE CERTIFICADO │
|
||||
│ │
|
||||
@ -120,14 +120,14 @@ El usuario debe recibir automáticamente un certificado digital en formato PDF a
|
||||
│ │ Módulos: 5 | Lecciones: 23 │ │
|
||||
│ │ │ │
|
||||
│ │ Instructor: Carlos Mendoza │ │
|
||||
│ │ Institución: Trading Platform │ │
|
||||
│ │ Institución: OrbiQuant IA │ │
|
||||
│ │ │ │
|
||||
│ │ Estado: ✅ Activo │ │
|
||||
│ │ Emitido: 05/12/2025 15:45:00 UTC │ │
|
||||
│ └────────────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ Este certificado puede ser verificado en cualquier momento en: │
|
||||
│ trading.com/verify/OQI-EDU-A3F8D291 │
|
||||
│ orbiquant.com/verify/OQI-EDU-A3F8D291 │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
@ -165,7 +165,7 @@ DADO que el usuario tiene un certificado
|
||||
CUANDO hace click en "Descargar PDF"
|
||||
ENTONCES se descarga archivo PDF
|
||||
Y el PDF contiene:
|
||||
- Logo de Trading Platform
|
||||
- Logo de OrbiQuant IA
|
||||
- Título "Certificado de Finalización"
|
||||
- Nombre completo del usuario
|
||||
- Título del curso
|
||||
@ -183,10 +183,10 @@ CUANDO hace click en "Compartir en LinkedIn"
|
||||
ENTONCES se abre nueva pestaña de LinkedIn
|
||||
Y el formulario de certificación está pre-llenado con:
|
||||
- Nombre: "Fibonacci Retracement Básico"
|
||||
- Organización: "Trading Platform"
|
||||
- Organización: "OrbiQuant IA"
|
||||
- Fecha de emisión: "Diciembre 2025"
|
||||
- ID de certificado: "OQI-EDU-A3F8D291"
|
||||
- URL de verificación: "trading.com/verify/..."
|
||||
- URL de verificación: "orbiquant.com/verify/..."
|
||||
```
|
||||
|
||||
**Escenario 5: Ver galería de certificados**
|
||||
@ -203,7 +203,7 @@ Y se pueden ordenar por: más reciente, alfabético
|
||||
**Escenario 6: Verificar certificado públicamente**
|
||||
```gherkin
|
||||
DADO que alguien tiene el ID de un certificado
|
||||
CUANDO accede a trading.com/verify/OQI-EDU-A3F8D291
|
||||
CUANDO accede a orbiquant.com/verify/OQI-EDU-A3F8D291
|
||||
ENTONCES se muestra página de verificación pública
|
||||
Y NO requiere login
|
||||
Y se muestra:
|
||||
@ -399,7 +399,7 @@ async function onCourseCompleted(userId, courseId) {
|
||||
|
||||
**LinkedIn pre-fill URL:**
|
||||
```javascript
|
||||
const linkedInUrl = `https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=${encodeURIComponent(courseTitle)}&organizationName=Trading Platform%20IA&issueYear=${year}&issueMonth=${month}&certUrl=${encodeURIComponent(verifyUrl)}&certId=${certificateNumber}`;
|
||||
const linkedInUrl = `https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=${encodeURIComponent(courseTitle)}&organizationName=OrbiQuant%20IA&issueYear=${year}&issueMonth=${month}&certUrl=${encodeURIComponent(verifyUrl)}&certId=${certificateNumber}`;
|
||||
```
|
||||
|
||||
**Seguridad:**
|
||||
|
||||
@ -497,7 +497,7 @@ recent_changes:
|
||||
description: "Seeds de cursos ICT/IPDA con 1 curso, 7 módulos, 28 lecciones, 5 quizzes"
|
||||
issues_found:
|
||||
- "DDL loader no carga 00-extensions.sql ni 01-enums.sql correctamente"
|
||||
- "Script usa DB_NAME=trading pero Docker usa trading_trading/trading_platform"
|
||||
- "Script usa DB_NAME=orbiquant pero Docker usa orbiquant_trading/orbiquant_platform"
|
||||
|
||||
- date: "2026-01-04"
|
||||
developer: "Claude Code"
|
||||
@ -510,8 +510,8 @@ recent_changes:
|
||||
fixes:
|
||||
- "Agregada carga de 00-extensions.sql antes de enums"
|
||||
- "Búsqueda de enums en 00-enums.sql y 01-enums.sql"
|
||||
- "Defaults unificados: DB_NAME=trading_platform, DB_PORT=5433"
|
||||
- "Credenciales: trading/trading_dev_2025"
|
||||
- "Defaults unificados: DB_NAME=orbiquantia_platform, DB_PORT=5433"
|
||||
- "Credenciales: orbiquantia/orbiquantia_dev_2025"
|
||||
- type: database_ddl
|
||||
files:
|
||||
- apps/database/ddl/schemas/auth/tables/01-users.sql
|
||||
|
||||
@ -43,7 +43,7 @@ El sistema debe:
|
||||
### RF-EDU-005.2: Contenido del Certificado
|
||||
|
||||
Cada certificado debe incluir:
|
||||
- Logo de Trading Platform
|
||||
- Logo de OrbiQuant IA
|
||||
- Título: "Certificado de Finalización"
|
||||
- Nombre completo del usuario
|
||||
- Título del curso completado
|
||||
@ -52,7 +52,7 @@ Cada certificado debe incluir:
|
||||
- Firma digital del instructor (imagen)
|
||||
- Firma digital de la plataforma
|
||||
- QR code para verificación online
|
||||
- Footer: "Verifica este certificado en trading.com/verify/{certificateId}"
|
||||
- Footer: "Verifica este certificado en orbiquant.com/verify/{certificateId}"
|
||||
|
||||
Template:
|
||||
```
|
||||
@ -77,7 +77,7 @@ Template:
|
||||
│ [Firma Instructor] [Firma Plataforma] │
|
||||
│ │
|
||||
│ [QR CODE] │
|
||||
│ Verifica en trading.com/verify/XXXX │
|
||||
│ Verifica en orbiquant.com/verify/XXXX │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
```
|
||||
@ -117,14 +117,14 @@ El sistema debe permitir:
|
||||
Integración LinkedIn:
|
||||
```javascript
|
||||
// Pre-llenar certificación en LinkedIn
|
||||
const linkedInUrl = `https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=${encodeURIComponent(courseTitle)}&organizationName=Trading Platform&issueYear=${year}&issueMonth=${month}&certUrl=${verifyUrl}&certId=${certificateId}`;
|
||||
const linkedInUrl = `https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=${encodeURIComponent(courseTitle)}&organizationName=OrbiQuant IA&issueYear=${year}&issueMonth=${month}&certUrl=${verifyUrl}&certId=${certificateId}`;
|
||||
```
|
||||
|
||||
### RF-EDU-005.6: Perfil Público de Certificados
|
||||
|
||||
El sistema debe:
|
||||
- Permitir al usuario crear perfil público opcional
|
||||
- URL: trading.com/u/:username/certificates
|
||||
- URL: orbiquant.com/u/:username/certificates
|
||||
- Mostrar solo certificados que el usuario hizo públicos
|
||||
- Galería visual de certificados
|
||||
- Bio del usuario
|
||||
@ -234,14 +234,14 @@ Escenario: Usuario comparte en LinkedIn
|
||||
ENTONCES se abre LinkedIn en nueva pestaña
|
||||
Y el formulario está pre-llenado con:
|
||||
- Nombre del curso
|
||||
- Organización: Trading Platform
|
||||
- Organización: OrbiQuant IA
|
||||
- Fecha de emisión
|
||||
- URL de verificación
|
||||
- ID del certificado
|
||||
|
||||
Escenario: Tercero verifica certificado
|
||||
DADO que alguien tiene el ID de un certificado
|
||||
CUANDO accede a trading.com/verify/OQI-EDU-12345678
|
||||
CUANDO accede a orbiquant.com/verify/OQI-EDU-12345678
|
||||
ENTONCES se muestra página de verificación
|
||||
Y se muestra: nombre del usuario, curso, fecha
|
||||
Y se muestra badge "✓ Certificado Válido"
|
||||
|
||||
@ -205,7 +205,7 @@ Ejemplos:
|
||||
El sistema debe permitir canjear XP o logros por:
|
||||
- Descuentos en suscripción premium (1000 XP = 5% descuento)
|
||||
- Acceso early a nuevos cursos (500 XP)
|
||||
- Merch de Trading Platform (camisetas, stickers) (5000 XP)
|
||||
- Merch de OrbiQuant (camisetas, stickers) (5000 XP)
|
||||
- Consulta 1-on-1 con instructor (10,000 XP)
|
||||
- Features premium temporales (2,000 XP = 1 mes)
|
||||
|
||||
@ -349,7 +349,7 @@ Escenario: Usuario ve leaderboard
|
||||
|
||||
Escenario: Usuario canjea recompensa
|
||||
DADO que el usuario tiene 5000 XP disponibles
|
||||
CUANDO canjea "Merch Trading Platform" (5000 XP)
|
||||
CUANDO canjea "Merch OrbiQuant" (5000 XP)
|
||||
ENTONCES se deduce 5000 XP de balance
|
||||
Y se registra el canje
|
||||
Y se envía email de confirmación
|
||||
|
||||
@ -72,7 +72,7 @@ Esta especificación detalla todos los endpoints REST API del módulo de trading
|
||||
## Base URL
|
||||
|
||||
```
|
||||
Production: https://api.trading.com/api/v1/trading
|
||||
Production: https://api.orbiquant.com/api/v1/trading
|
||||
Development: http://localhost:3001/api/v1/trading
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
# Especificaciones Técnicas - OQI-003 Trading y Charts
|
||||
|
||||
Este directorio contiene las especificaciones técnicas detalladas para el módulo de Trading y Charts de Trading Platform.
|
||||
Este directorio contiene las especificaciones técnicas detalladas para el módulo de Trading y Charts de OrbiQuant IA.
|
||||
|
||||
## Índice de Especificaciones
|
||||
|
||||
@ -212,7 +212,7 @@ BINANCE_API_KEY=your_api_key
|
||||
BINANCE_API_SECRET=your_api_secret
|
||||
|
||||
# Database
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/trading
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/orbiquant
|
||||
DB_SCHEMA=trading
|
||||
|
||||
# Redis
|
||||
@ -231,7 +231,7 @@ WS_URL=ws://localhost:3001
|
||||
|
||||
```bash
|
||||
# Crear schema de base de datos
|
||||
psql -d trading -f migrations/001_create_trading_schema.sql
|
||||
psql -d orbiquant -f migrations/001_create_trading_schema.sql
|
||||
|
||||
# Ejecutar tests
|
||||
npm run test:backend
|
||||
|
||||
@ -111,7 +111,7 @@ ENTONCES se muestra un tooltip con:
|
||||
- [ ] El chart debe ser responsive y funcionar en mobile
|
||||
- [ ] Colores de velas: Verde para alcista, Rojo para bajista
|
||||
- [ ] Crosshair debe seguir el cursor
|
||||
- [ ] Logo watermark de Trading Platform en esquina
|
||||
- [ ] Logo watermark de OrbiQuant en esquina
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -776,7 +776,7 @@ END $$;
|
||||
|
||||
```bash
|
||||
# Database
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/trading
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/orbiquant
|
||||
DATABASE_POOL_MIN=2
|
||||
DATABASE_POOL_MAX=10
|
||||
|
||||
|
||||
@ -1241,7 +1241,7 @@ describe('Investment Accounts API', () => {
|
||||
```yaml
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: Trading Platform - Investment API
|
||||
title: OrbiQuant IA - Investment API
|
||||
version: 1.0.0
|
||||
description: API para gestión de cuentas de inversión
|
||||
|
||||
|
||||
@ -754,7 +754,7 @@ REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_51abc...
|
||||
### 6.2 Configuración de Webhook en Stripe Dashboard
|
||||
|
||||
1. Ir a Stripe Dashboard > Developers > Webhooks
|
||||
2. Crear endpoint: `https://api.trading.com/webhooks/stripe`
|
||||
2. Crear endpoint: `https://api.orbiquant.com/webhooks/stripe`
|
||||
3. Seleccionar eventos:
|
||||
- `payment_intent.succeeded`
|
||||
- `payment_intent.payment_failed`
|
||||
|
||||
@ -36,7 +36,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Descripción Detallada
|
||||
|
||||
El usuario debe poder generar y descargar un reporte PDF profesional que incluya: resumen de la cuenta, rendimiento histórico, gráficos, lista de transacciones, métricas clave, y disclaimers legales. El PDF debe ser bien formateado, con branding de Trading Platform, y optimizado para impresión.
|
||||
El usuario debe poder generar y descargar un reporte PDF profesional que incluya: resumen de la cuenta, rendimiento histórico, gráficos, lista de transacciones, métricas clave, y disclaimers legales. El PDF debe ser bien formateado, con branding de OrbiQuant IA, y optimizado para impresión.
|
||||
|
||||
## Mockups/Wireframes
|
||||
|
||||
@ -119,7 +119,7 @@ El usuario debe poder generar y descargar un reporte PDF profesional que incluya
|
||||
│ [Más secciones...] │
|
||||
│ │
|
||||
│ ──────────────────────────────────────────────────────────── │
|
||||
│ Página 1 de 5 trading.ai │
|
||||
│ Página 1 de 5 orbiquant.ai │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
@ -187,7 +187,7 @@ Y se sugiere generar reporte personalizado desde fecha de apertura
|
||||
|
||||
- [ ] PDF optimizado para impresión (tamaño A4)
|
||||
- [ ] Incluir tabla de contenidos en reportes largos
|
||||
- [ ] Marca de agua "Generado por Trading Platform"
|
||||
- [ ] Marca de agua "Generado por OrbiQuant IA"
|
||||
- [ ] Footer con disclaimers legales
|
||||
- [ ] Compresión de imágenes para tamaño óptimo
|
||||
- [ ] Límite de 10 MB por archivo
|
||||
@ -297,7 +297,7 @@ Y se sugiere generar reporte personalizado desde fecha de apertura
|
||||
**Estructura del PDF:**
|
||||
|
||||
1. **Portada**
|
||||
- Logo Trading Platform
|
||||
- Logo OrbiQuant IA
|
||||
- Título "Reporte de Inversión"
|
||||
- Nombre de cuenta y titular
|
||||
- Período del reporte
|
||||
|
||||
@ -636,7 +636,7 @@ GROUP BY user_id;
|
||||
|
||||
```bash
|
||||
# Database
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/trading
|
||||
DATABASE_URL=postgresql://user:password@localhost:5432/orbiquant
|
||||
|
||||
# Financial Schema
|
||||
FINANCIAL_DEFAULT_CURRENCY=usd
|
||||
|
||||
@ -64,7 +64,7 @@ Implementación de medidas de seguridad para cumplimiento PCI DSS:
|
||||
|
||||
**SAQ-A (Self-Assessment Questionnaire A)**
|
||||
|
||||
Trading Platform califica para SAQ-A porque:
|
||||
OrbiQuant califica para SAQ-A porque:
|
||||
- No almacena, procesa ni transmite datos de tarjetas
|
||||
- Usa Stripe.js y Elements (redirección completa a Stripe)
|
||||
- Solo maneja tokens de Stripe, no datos de tarjetas
|
||||
|
||||
@ -24,7 +24,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** visitante o usuario registrado de Trading Platform
|
||||
**Como** visitante o usuario registrado de OrbiQuant
|
||||
**Quiero** ver los diferentes planes de suscripción disponibles con sus características y precios
|
||||
**Para** decidir cuál plan se adapta mejor a mis necesidades de trading
|
||||
|
||||
@ -251,7 +251,7 @@ Próximamente ofreceremos planes anuales con 20% de descuento.
|
||||
|
||||
### SEO
|
||||
|
||||
- Meta title: "Planes y Precios - Trading Platform"
|
||||
- Meta title: "Planes y Precios - OrbiQuant IA"
|
||||
- Meta description: "Elige el plan perfecto para tu trading. Desde gratis hasta $99/mes con análisis personalizados."
|
||||
- Schema markup: `offers` para planes
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario registrado de Trading Platform
|
||||
**Como** usuario registrado de OrbiQuant
|
||||
**Quiero** suscribirme a un plan de pago (Basic, Pro o Premium)
|
||||
**Para** acceder a funcionalidades premium y mejorar mi experiencia de trading
|
||||
|
||||
@ -225,7 +225,7 @@ Feature: Suscripción a Plan Pro
|
||||
And después de 2-5 segundos debería ver página de confirmación
|
||||
And debería ver mensaje "¡Trial iniciado! No se te cobrará hasta el 12/12/2025"
|
||||
|
||||
And debería recibir email con asunto "Bienvenido a Trading Platform Pro"
|
||||
And debería recibir email con asunto "Bienvenido a OrbiQuant Pro"
|
||||
And mi perfil debería mostrar badge "Pro"
|
||||
And debería tener acceso a predicciones avanzadas
|
||||
And debería tener acceso a todos los cursos
|
||||
@ -303,12 +303,12 @@ Feature: Suscripción a Plan Pro
|
||||
|
||||
### Email Templates
|
||||
|
||||
**Subject:** Bienvenido a Trading Platform Pro
|
||||
**Subject:** Bienvenido a OrbiQuant Pro
|
||||
|
||||
```
|
||||
Hola Juan,
|
||||
|
||||
¡Bienvenido a Trading Platform Pro! 🎉
|
||||
¡Bienvenido a OrbiQuant Pro! 🎉
|
||||
|
||||
Tu trial de 7 días ha comenzado. Tienes acceso completo a:
|
||||
✅ Predicciones avanzadas con IA
|
||||
@ -321,10 +321,10 @@ Tu primer cobro será el 12/12/2025 por $49 USD.
|
||||
Puedes cancelar en cualquier momento desde:
|
||||
[Gestionar Suscripción]
|
||||
|
||||
¿Preguntas? Escríbenos a support@trading.com
|
||||
¿Preguntas? Escríbenos a support@orbiquant.com
|
||||
|
||||
Saludos,
|
||||
El equipo de Trading Platform
|
||||
El equipo de OrbiQuant
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -24,7 +24,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform (con o sin suscripción)
|
||||
**Como** usuario de OrbiQuant (con o sin suscripción)
|
||||
**Quiero** comprar acceso a un curso específico con pago único
|
||||
**Para** aprender sobre trading sin compromiso de suscripción mensual
|
||||
|
||||
@ -353,10 +353,10 @@ Detalles de la compra:
|
||||
- Fecha: 05/12/2025
|
||||
- Factura: INV-2025-000042
|
||||
|
||||
¿Necesitas ayuda? Escríbenos a support@trading.com
|
||||
¿Necesitas ayuda? Escríbenos a support@orbiquant.com
|
||||
|
||||
¡Feliz aprendizaje!
|
||||
El equipo de Trading Platform
|
||||
El equipo de OrbiQuant
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -24,7 +24,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario registrado de Trading Platform
|
||||
**Como** usuario registrado de OrbiQuant
|
||||
**Quiero** agregar y gestionar mis métodos de pago
|
||||
**Para** realizar compras y renovar suscripciones sin fricciones
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform que ha realizado pagos
|
||||
**Como** usuario de OrbiQuant que ha realizado pagos
|
||||
**Quiero** ver y descargar mis facturas
|
||||
**Para** tener comprobantes de mis transacciones y poder deducir impuestos
|
||||
|
||||
@ -64,9 +64,9 @@ updated_date: "2026-01-04"
|
||||
**Cuando** hago click en "Descargar PDF"
|
||||
**Entonces** debería:
|
||||
- Descargar archivo PDF inmediatamente
|
||||
- Nombre del archivo: `Trading Platform_Factura_INV-2025-000042.pdf`
|
||||
- Nombre del archivo: `OrbiQuant_Factura_INV-2025-000042.pdf`
|
||||
- PDF contiene:
|
||||
- Logo de Trading Platform
|
||||
- Logo de OrbiQuant
|
||||
- Datos fiscales de empresa
|
||||
- Mis datos (nombre, email, país)
|
||||
- Número de factura y fecha
|
||||
@ -94,7 +94,7 @@ updated_date: "2026-01-04"
|
||||
**Entonces** debería:
|
||||
- Ver confirmación: "Factura enviada a juan@example.com"
|
||||
- Recibir email con:
|
||||
- Asunto: "Tu factura de Trading Platform - #INV-2025-000042"
|
||||
- Asunto: "Tu factura de OrbiQuant - #INV-2025-000042"
|
||||
- PDF adjunto
|
||||
- Link de descarga (válido 24h)
|
||||
|
||||
@ -259,9 +259,9 @@ Feature: Ver y Descargar Facturas
|
||||
Scenario: Descargar factura PDF
|
||||
Given que estoy viendo mi lista de facturas
|
||||
When hago click en "Descargar PDF" en factura "INV-2025-000042"
|
||||
Then debería descargar archivo "Trading Platform_Factura_INV-2025-000042.pdf"
|
||||
Then debería descargar archivo "OrbiQuant_Factura_INV-2025-000042.pdf"
|
||||
And el PDF debería contener mis datos fiscales
|
||||
And el PDF debería tener logo de Trading Platform
|
||||
And el PDF debería tener logo de OrbiQuant
|
||||
And el PDF debería mostrar total de $56.84 (incluido IVA)
|
||||
|
||||
Scenario: Ver detalles de factura
|
||||
@ -351,12 +351,12 @@ Feature: Ver y Descargar Facturas
|
||||
|
||||
### PDF Storage
|
||||
|
||||
- S3 Bucket: `trading-invoices`
|
||||
- S3 Bucket: `orbiquant-invoices`
|
||||
- Path: `invoices/{year}/{month}/{invoiceId}.pdf`
|
||||
- Generar URL firmada con expiración:
|
||||
```typescript
|
||||
const url = s3.getSignedUrl('getObject', {
|
||||
Bucket: 'trading-invoices',
|
||||
Bucket: 'orbiquant-invoices',
|
||||
Key: `invoices/2025/12/${invoiceId}.pdf`,
|
||||
Expires: 86400, // 24 horas
|
||||
});
|
||||
@ -364,12 +364,12 @@ const url = s3.getSignedUrl('getObject', {
|
||||
|
||||
### Email Template
|
||||
|
||||
**Subject:** Tu factura de Trading Platform - #INV-2025-000042
|
||||
**Subject:** Tu factura de OrbiQuant - #INV-2025-000042
|
||||
|
||||
```
|
||||
Hola Juan,
|
||||
|
||||
Adjuntamos tu factura de Trading Platform.
|
||||
Adjuntamos tu factura de OrbiQuant.
|
||||
|
||||
Número de factura: INV-2025-000042
|
||||
Fecha: 05/12/2025
|
||||
@ -378,10 +378,10 @@ Total: $56.84 USD
|
||||
También puedes descargarla desde:
|
||||
[Descargar Factura] (válido por 24 horas)
|
||||
|
||||
¿Necesitas ayuda? Escríbenos a billing@trading.com
|
||||
¿Necesitas ayuda? Escríbenos a billing@orbiquant.com
|
||||
|
||||
Saludos,
|
||||
El equipo de Trading Platform
|
||||
El equipo de OrbiQuant
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -24,7 +24,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Historia de Usuario
|
||||
|
||||
**Como** usuario de Trading Platform con actividad de pagos
|
||||
**Como** usuario de OrbiQuant con actividad de pagos
|
||||
**Quiero** ver un historial completo de mis transacciones
|
||||
**Para** rastrear mis gastos, recargas de wallet y compras realizadas
|
||||
|
||||
@ -323,7 +323,7 @@ Feature: Ver Historial de Pagos
|
||||
When hago click en "Exportar"
|
||||
And selecciono "CSV"
|
||||
And selecciono "Últimos 3 meses"
|
||||
Then debería descargar archivo "Trading Platform_Historial_2025.csv"
|
||||
Then debería descargar archivo "OrbiQuant_Historial_2025.csv"
|
||||
And archivo debería contener todas las transacciones del período
|
||||
|
||||
Scenario: Usuario sin transacciones
|
||||
|
||||
@ -178,8 +178,8 @@ POST /api/v1/payments/create-checkout-session
|
||||
{
|
||||
"priceId": "price_1Sb3k64dPtEGmLmpm5n5bbJH",
|
||||
"mode": "subscription",
|
||||
"successUrl": "https://app.trading.com/checkout/success?session_id={CHECKOUT_SESSION_ID}",
|
||||
"cancelUrl": "https://app.trading.com/pricing"
|
||||
"successUrl": "https://app.orbiquant.com/checkout/success?session_id={CHECKOUT_SESSION_ID}",
|
||||
"cancelUrl": "https://app.orbiquant.com/pricing"
|
||||
}
|
||||
```
|
||||
|
||||
@ -432,17 +432,17 @@ VITE_STRIPE_PUBLISHABLE_KEY=pk_test_51Sb3k64dPtEGmLmp...
|
||||
# Backend (.env)
|
||||
STRIPE_SECRET_KEY=sk_test_51Sb3k64dPtEGmLmp...
|
||||
STRIPE_WEBHOOK_SECRET=whsec_...
|
||||
FRONTEND_URL=https://app.trading.com
|
||||
FRONTEND_URL=https://app.orbiquant.com
|
||||
```
|
||||
|
||||
### Stripe Checkout URLs
|
||||
|
||||
```typescript
|
||||
// success_url
|
||||
https://app.trading.com/checkout/success?session_id={CHECKOUT_SESSION_ID}
|
||||
https://app.orbiquant.com/checkout/success?session_id={CHECKOUT_SESSION_ID}
|
||||
|
||||
// cancel_url
|
||||
https://app.trading.com/pricing
|
||||
https://app.orbiquant.com/pricing
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -68,10 +68,10 @@ El sistema debe generar, almacenar y entregar facturas electrónicas automática
|
||||
**DEBE incluir:**
|
||||
|
||||
**Información del Emisor:**
|
||||
- Razón Social: "Trading Platform Inc."
|
||||
- Razón Social: "OrbiQuant IA Inc."
|
||||
- RFC/Tax ID: XX-XXXXXXX-XX
|
||||
- Dirección fiscal completa
|
||||
- Email de contacto: billing@trading.com
|
||||
- Email de contacto: billing@orbiquant.com
|
||||
|
||||
**Información del Cliente:**
|
||||
- Nombre completo
|
||||
@ -129,7 +129,7 @@ async function generateInvoiceNumber(type: InvoiceType): Promise<string> {
|
||||
**DEBE:**
|
||||
1. Usar librería de generación de PDF (puppeteer, pdfkit, react-pdf)
|
||||
2. Aplicar diseño responsive (A4)
|
||||
3. Incluir logo de Trading Platform
|
||||
3. Incluir logo de OrbiQuant
|
||||
4. Soportar múltiples idiomas (ES, EN)
|
||||
5. Tamaño máximo: 1 MB
|
||||
|
||||
@ -137,9 +137,9 @@ async function generateInvoiceNumber(type: InvoiceType): Promise<string> {
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ [Logo Trading Platform] FACTURA / INVOICE │
|
||||
│ [Logo OrbiQuant] FACTURA / INVOICE │
|
||||
│ │
|
||||
│ Trading Platform Inc. #INV-2025-000042 │
|
||||
│ OrbiQuant IA Inc. #INV-2025-000042 │
|
||||
│ 1234 Tech Street Fecha: 05/12/2025 │
|
||||
│ San Francisco, CA 94105 │
|
||||
│ RFC: XX-XXXXXXX-XX │
|
||||
@ -170,7 +170,7 @@ async function generateInvoiceNumber(type: InvoiceType): Promise<string> {
|
||||
│ │
|
||||
│ Powered by Stripe | ID: pi_3Abc123... │
|
||||
│ │
|
||||
│ Dudas: support@trading.com │
|
||||
│ Dudas: support@orbiquant.com │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
```
|
||||
@ -222,7 +222,7 @@ class Invoice {
|
||||
|
||||
**Template de Email:**
|
||||
```
|
||||
Asunto: Tu factura de Trading Platform - #INV-2025-000042
|
||||
Asunto: Tu factura de OrbiQuant - #INV-2025-000042
|
||||
|
||||
Hola Juan,
|
||||
|
||||
@ -236,10 +236,10 @@ Detalles de la compra:
|
||||
- Período: 01/01/2025 - 31/01/2025
|
||||
- Total: $49.00 USD
|
||||
|
||||
¿Preguntas? Escríbenos a support@trading.com
|
||||
¿Preguntas? Escríbenos a support@orbiquant.com
|
||||
|
||||
Saludos,
|
||||
El equipo de Trading Platform
|
||||
El equipo de OrbiQuant
|
||||
```
|
||||
|
||||
### RF-PAY-004.7: Actualización de Datos Fiscales
|
||||
@ -387,19 +387,19 @@ El equipo de Trading Platform
|
||||
|
||||
```env
|
||||
# Storage
|
||||
AWS_S3_BUCKET=trading-invoices
|
||||
AWS_S3_BUCKET=orbiquant-invoices
|
||||
AWS_S3_REGION=us-east-1
|
||||
INVOICE_PDF_RETENTION_YEARS=7
|
||||
|
||||
# Facturación
|
||||
COMPANY_LEGAL_NAME="Trading Platform Inc."
|
||||
COMPANY_LEGAL_NAME="OrbiQuant IA Inc."
|
||||
COMPANY_TAX_ID=XX-XXXXXXX-XX
|
||||
COMPANY_ADDRESS="1234 Tech Street, San Francisco, CA 94105"
|
||||
COMPANY_EMAIL=billing@trading.com
|
||||
COMPANY_EMAIL=billing@orbiquant.com
|
||||
|
||||
# Email
|
||||
INVOICE_FROM_EMAIL=billing@trading.com
|
||||
INVOICE_REPLY_TO=support@trading.com
|
||||
INVOICE_FROM_EMAIL=billing@orbiquant.com
|
||||
INVOICE_REPLY_TO=support@orbiquant.com
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -351,7 +351,7 @@ Stripe reintenta webhooks automáticamente:
|
||||
|
||||
1. Ir a **Developers → Webhooks**
|
||||
2. Click "Add endpoint"
|
||||
3. URL: `https://api.trading.com/payments/webhook`
|
||||
3. URL: `https://api.orbiquant.com/payments/webhook`
|
||||
4. Seleccionar eventos:
|
||||
|
||||
**Eventos esenciales (P0):**
|
||||
|
||||
@ -350,7 +350,7 @@ class Refund {
|
||||
### RN-003: Fees de Stripe
|
||||
|
||||
- Stripe **NO devuelve** el fee de procesamiento (~2.9% + $0.30)
|
||||
- Trading Platform absorbe este costo
|
||||
- OrbiQuant absorbe este costo
|
||||
- Calcular pérdida real: `loss = refundAmount * 0.029 + 0.30`
|
||||
|
||||
### RN-004: Reembolso de Suscripciones
|
||||
@ -398,7 +398,7 @@ class Refund {
|
||||
- Reembolsos manuales: 1-3 días hábiles de revisión
|
||||
|
||||
## Contacto
|
||||
Si tienes dudas, contacta a support@trading.com
|
||||
Si tienes dudas, contacta a support@orbiquant.com
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@ -329,7 +329,7 @@ BINANCE_API_KEY=xxx # Opcional para rate limits
|
||||
|
||||
```bash
|
||||
cd apps/ml-services
|
||||
conda activate trading-ml
|
||||
conda activate orbiquantia-ml
|
||||
uvicorn src.api.server:app --host 0.0.0.0 --port 8000 --reload
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Descripcion General
|
||||
|
||||
Este directorio contiene la documentacion formal de epicas e historias de usuario para el modulo de Senales ML de Trading Platform, con enfoque en la estrategia AMD (Accumulation-Manipulation-Distribution) y modelos ML avanzados.
|
||||
Este directorio contiene la documentacion formal de epicas e historias de usuario para el modulo de Senales ML de OrbiQuant IA, con enfoque en la estrategia AMD (Accumulation-Manipulation-Distribution) y modelos ML avanzados.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ async def lifespan(app: FastAPI):
|
||||
await market_fetcher.stop()
|
||||
|
||||
app = FastAPI(
|
||||
title="Trading Platform ML Engine",
|
||||
title="OrbiQuant ML Engine",
|
||||
version="1.0.0",
|
||||
lifespan=lifespan
|
||||
)
|
||||
|
||||
@ -6,9 +6,9 @@ status: "Done"
|
||||
priority: "Alta"
|
||||
epic: "OQI-006"
|
||||
project: "trading-platform"
|
||||
version: "2.0.0"
|
||||
version: "1.0.0"
|
||||
created_date: "2025-12-05"
|
||||
updated_date: "2026-01-07"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# ET-ML-004: FastAPI Endpoints
|
||||
@ -20,9 +20,9 @@ updated_date: "2026-01-07"
|
||||
| **ID** | ET-ML-004 |
|
||||
| **Épica** | OQI-006 - Señales ML |
|
||||
| **Tipo** | Especificación Técnica |
|
||||
| **Versión** | 2.0.0 |
|
||||
| **Estado** | Implementado |
|
||||
| **Última actualización** | 2026-01-07 |
|
||||
| **Versión** | 1.0.0 |
|
||||
| **Estado** | Aprobado |
|
||||
| **Última actualización** | 2025-12-05 |
|
||||
|
||||
---
|
||||
|
||||
@ -32,396 +32,13 @@ Especificar los endpoints de la API REST del ML Engine, incluyendo schemas de re
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ IMPORTANTE: Realidad vs Planificación
|
||||
|
||||
Este documento contiene DOS secciones de endpoints:
|
||||
1. **ENDPOINTS IMPLEMENTADOS** (v2.0.0) - Endpoints reales en producción
|
||||
2. **ENDPOINTS PLANIFICADOS** (v1.0.0) - Diseño original (para referencia)
|
||||
|
||||
---
|
||||
|
||||
## Base URL
|
||||
|
||||
```
|
||||
Production: https://ml.orbiquant.com/
|
||||
Development: http://localhost:3083/
|
||||
Production: https://ml.orbiquant.com/api/v1
|
||||
Development: http://localhost:8000/api/v1
|
||||
```
|
||||
|
||||
> **NOTA:** La API NO usa versionado en rutas (`/api/v1`). El versionado se maneja via headers.
|
||||
|
||||
---
|
||||
|
||||
# ENDPOINTS IMPLEMENTADOS (v2.0.0)
|
||||
|
||||
Esta sección documenta los endpoints **realmente implementados** en `apps/ml-engine/src/api/main.py`.
|
||||
|
||||
## 1. Health & System
|
||||
|
||||
### GET /health
|
||||
Health check básico.
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
status: string; // "healthy"
|
||||
version: string; // "0.1.0"
|
||||
models_loaded: boolean;
|
||||
timestamp: string; // ISO 8601
|
||||
}
|
||||
```
|
||||
|
||||
### GET /models
|
||||
Lista modelos disponibles y su estado.
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
Array<{
|
||||
model_type: string; // "range_predictor" | "tpsl_classifier"
|
||||
version: string;
|
||||
status: string; // "deployed"
|
||||
horizons: string[]; // ["15m", "1h"]
|
||||
supported_symbols: string[];
|
||||
last_trained?: string;
|
||||
metrics?: Record<string, number>;
|
||||
}>
|
||||
```
|
||||
|
||||
### GET /symbols
|
||||
Lista símbolos de trading disponibles.
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
["XAUUSD", "EURUSD", "GBPUSD", "USDJPY", "BTCUSD", "ETHUSD"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Predictions
|
||||
|
||||
### POST /predict/range
|
||||
Predice rangos de precio (ΔHigh/ΔLow) para un símbolo.
|
||||
|
||||
**Request:**
|
||||
```typescript
|
||||
{
|
||||
symbol: string; // "XAUUSD"
|
||||
timeframe?: string; // "5m" | "15m" | "30m" | "1h" | "4h" | "1d" (default: "15m")
|
||||
horizon?: string; // Prediction horizon (default: "15m")
|
||||
features?: Record<string, number>; // Pre-computed features (optional)
|
||||
}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
Array<{
|
||||
horizon: string;
|
||||
delta_high: number;
|
||||
delta_low: number;
|
||||
delta_high_bin?: number;
|
||||
delta_low_bin?: number;
|
||||
confidence_high: number;
|
||||
confidence_low: number;
|
||||
}>
|
||||
```
|
||||
|
||||
### POST /predict/tpsl
|
||||
Predice probabilidad de alcanzar TP antes que SL.
|
||||
|
||||
**Request:**
|
||||
```typescript
|
||||
{
|
||||
symbol: string;
|
||||
timeframe?: string; // default: "15m"
|
||||
horizon?: string;
|
||||
}
|
||||
```
|
||||
|
||||
**Query Parameters:**
|
||||
- `rr_config`: string - "rr_2_1" | "rr_3_1" (default: "rr_2_1")
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
prob_tp_first: number; // 0.0 - 1.0
|
||||
rr_config: string;
|
||||
confidence: number;
|
||||
calibrated: boolean;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Signals
|
||||
|
||||
### POST /generate/signal
|
||||
Genera señal de trading completa combinando range prediction, TP/SL y AMD.
|
||||
|
||||
**Request:**
|
||||
```typescript
|
||||
{
|
||||
symbol: string;
|
||||
timeframe?: string;
|
||||
horizon?: string;
|
||||
features?: Record<string, number>;
|
||||
}
|
||||
```
|
||||
|
||||
**Query Parameters:**
|
||||
- `rr_config`: string - Risk/Reward config (default: "rr_2_1")
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
signal_id: string;
|
||||
symbol: string;
|
||||
direction: "long" | "short";
|
||||
entry_price: number;
|
||||
stop_loss: number;
|
||||
take_profit: number;
|
||||
risk_reward_ratio: number;
|
||||
prob_tp_first: number;
|
||||
confidence_score: number;
|
||||
amd_phase: "accumulation" | "manipulation" | "distribution" | "unknown";
|
||||
volatility_regime: "low" | "medium" | "high" | "extreme";
|
||||
range_prediction: RangePredictionResponse;
|
||||
timestamp: string;
|
||||
valid_until: string;
|
||||
metadata?: Record<string, any>;
|
||||
}
|
||||
```
|
||||
|
||||
### GET /api/signals/active
|
||||
Obtiene señales activas para múltiples símbolos en paralelo.
|
||||
|
||||
**Query Parameters:**
|
||||
- `symbols`: string - Comma-separated (default: all)
|
||||
- `timeframe`: string - "15m" | "1h" etc. (default: "15m")
|
||||
- `rr_config`: string - (default: "rr_2_1")
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
signals: SignalResponse[];
|
||||
generated_at: string;
|
||||
symbols_processed: string[];
|
||||
errors: string[];
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. AMD (Accumulation-Manipulation-Distribution)
|
||||
|
||||
### POST /api/amd/{symbol}
|
||||
Detecta fase AMD actual para un símbolo usando Smart Money Concepts.
|
||||
|
||||
**Path Parameters:**
|
||||
- `symbol`: string - Trading symbol
|
||||
|
||||
**Query Parameters:**
|
||||
- `timeframe`: string - (default: "15m")
|
||||
- `lookback_periods`: number - 50-500 (default: 100)
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
phase: "accumulation" | "manipulation" | "distribution" | "unknown";
|
||||
confidence: number;
|
||||
start_time: string;
|
||||
end_time?: string;
|
||||
characteristics: Record<string, number>;
|
||||
signals: string[];
|
||||
strength: number;
|
||||
trading_bias: Record<string, any>;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. ICT/SMC (Inner Circle Trader / Smart Money Concepts)
|
||||
|
||||
### POST /api/ict/{symbol}
|
||||
Análisis ICT/SMC completo detectando Order Blocks, FVG, Liquidity Sweeps, etc.
|
||||
|
||||
**Path Parameters:**
|
||||
- `symbol`: string - Trading symbol
|
||||
|
||||
**Query Parameters:**
|
||||
- `timeframe`: string - (default: "1h")
|
||||
- `lookback_periods`: number - 100-500 (default: 200)
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
timestamp: string;
|
||||
symbol: string;
|
||||
timeframe: string;
|
||||
market_bias: string;
|
||||
bias_confidence: number;
|
||||
current_trend: string;
|
||||
order_blocks: OrderBlock[];
|
||||
fair_value_gaps: FVG[];
|
||||
liquidity_sweeps: LiquiditySweep[];
|
||||
structure_breaks: StructureBreak[];
|
||||
premium_zone: { low: number; high: number };
|
||||
discount_zone: { low: number; high: number };
|
||||
equilibrium: number;
|
||||
entry_zone?: { low: number; high: number };
|
||||
stop_loss?: number;
|
||||
take_profits: { tp1?: number; tp2?: number; tp3?: number };
|
||||
risk_reward?: number;
|
||||
signals: string[];
|
||||
score: number;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Ensemble (Multi-Strategy)
|
||||
|
||||
### POST /api/ensemble/{symbol}
|
||||
Obtiene señal combinada del ensemble de estrategias.
|
||||
|
||||
Combina:
|
||||
- AMD Detector (25% weight)
|
||||
- ICT/SMC Detector (35% weight)
|
||||
- Range Predictor (20% weight)
|
||||
- TP/SL Classifier (20% weight)
|
||||
|
||||
**Path Parameters:**
|
||||
- `symbol`: string
|
||||
|
||||
**Query Parameters:**
|
||||
- `timeframe`: string - (default: "1h")
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
timestamp: string;
|
||||
symbol: string;
|
||||
timeframe: string;
|
||||
action: string;
|
||||
confidence: number;
|
||||
strength: string;
|
||||
scores: { bullish: number; bearish: number; net: number };
|
||||
levels: { entry?: number; stop_loss?: number; take_profit_1?: number; ... };
|
||||
position: { risk_percent: number; size_multiplier: number };
|
||||
model_signals: ModelSignal[];
|
||||
confluence_count: number;
|
||||
market_phase: string;
|
||||
market_bias: string;
|
||||
key_levels: Record<string, number>;
|
||||
signals: string[];
|
||||
setup_score: number;
|
||||
}
|
||||
```
|
||||
|
||||
### GET /api/ensemble/quick/{symbol}
|
||||
Señal rápida simplificada para consumo inmediato.
|
||||
|
||||
**Path Parameters:**
|
||||
- `symbol`: string
|
||||
|
||||
**Query Parameters:**
|
||||
- `timeframe`: string - (default: "1h")
|
||||
|
||||
**Response:** Simplified signal object
|
||||
|
||||
---
|
||||
|
||||
## 7. Scanner (Multi-Symbol)
|
||||
|
||||
### POST /api/scan
|
||||
Escanea múltiples símbolos buscando oportunidades de trading.
|
||||
|
||||
**Request:**
|
||||
```typescript
|
||||
{
|
||||
symbols: string[]; // ["XAUUSD", "EURUSD", ...]
|
||||
timeframe?: string; // default: "1h"
|
||||
min_score?: number; // 0-100 (default: 50)
|
||||
}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
{
|
||||
timestamp: string;
|
||||
signals: QuickSignal[];
|
||||
best_setups: QuickSignal[]; // Top 5 by score
|
||||
market_overview: {
|
||||
total_analyzed: number;
|
||||
bullish: number;
|
||||
bearish: number;
|
||||
neutral: number;
|
||||
sentiment: "bullish" | "bearish" | "neutral";
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8. Training & Backtesting
|
||||
|
||||
### POST /api/backtest
|
||||
Ejecuta backtest en datos históricos (mock implementation).
|
||||
|
||||
**Request:**
|
||||
```typescript
|
||||
{
|
||||
symbol: string;
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
initial_capital?: number; // default: 10000
|
||||
risk_per_trade?: number; // 0.001-0.1 (default: 0.02)
|
||||
rr_config?: string;
|
||||
filter_by_amd?: boolean; // default: true
|
||||
min_confidence?: number; // 0-1 (default: 0.55)
|
||||
}
|
||||
```
|
||||
|
||||
### POST /api/train/full
|
||||
Entrena modelos ML con walk-forward validation (mock implementation).
|
||||
|
||||
**Request:**
|
||||
```typescript
|
||||
{
|
||||
symbol: string;
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
models_to_train?: string[]; // default: ["range_predictor", "tpsl_classifier"]
|
||||
use_walk_forward?: boolean; // default: true
|
||||
n_splits?: number; // 2-10 (default: 5)
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9. WebSocket
|
||||
|
||||
### WS /ws/signals
|
||||
WebSocket para señales en tiempo real.
|
||||
|
||||
**Connection:** `ws://localhost:3083/ws/signals`
|
||||
|
||||
**Message Format:**
|
||||
```typescript
|
||||
{
|
||||
type: "signal";
|
||||
data: {
|
||||
symbol: string;
|
||||
direction: string;
|
||||
timestamp: string;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# ENDPOINTS PLANIFICADOS (v1.0.0 - Referencia)
|
||||
|
||||
Los siguientes endpoints fueron el diseño original pero **NO están implementados** o tienen rutas diferentes:
|
||||
|
||||
---
|
||||
|
||||
## Autenticación
|
||||
@ -485,7 +102,7 @@ Genera predicción de rango de precio.
|
||||
|
||||
**Example:**
|
||||
```bash
|
||||
curl -X POST https://ml.trading.com/api/v1/predictions \
|
||||
curl -X POST https://ml.orbiquant.com/api/v1/predictions \
|
||||
-H "X-API-Key: your-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"symbol": "BTCUSDT", "horizon": 18}'
|
||||
@ -591,7 +208,7 @@ Genera señal de trading.
|
||||
|
||||
**Example:**
|
||||
```bash
|
||||
curl -X POST https://ml.trading.com/api/v1/signals \
|
||||
curl -X POST https://ml.orbiquant.com/api/v1/signals \
|
||||
-H "X-API-Key: your-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"symbol": "BTCUSDT", "horizon": 18, "include_range": true, "include_tpsl": true}'
|
||||
@ -1154,65 +771,13 @@ class ModelError(APIError):
|
||||
|
||||
---
|
||||
|
||||
# RESUMEN DE DISCREPANCIAS
|
||||
|
||||
## Endpoints Documentados vs Implementados
|
||||
|
||||
| Endpoint Original | Estado | Endpoint Real |
|
||||
|-------------------|--------|---------------|
|
||||
| `POST /api/v1/predictions` | ⚠️ Diferente ruta | `POST /predict/range` |
|
||||
| `POST /api/v1/signals` | ⚠️ Diferente ruta | `POST /generate/signal` |
|
||||
| `GET /api/v1/signals/history` | ❌ No implementado | - |
|
||||
| `GET /api/v1/indicators` | ❌ No implementado | - |
|
||||
| `GET /api/v1/models/status` | ⚠️ Diferente ruta | `GET /models` |
|
||||
| `GET /api/v1/models/{name}/metrics` | ❌ No implementado | - |
|
||||
| `GET /api/v1/health` | ⚠️ Sin versioning | `GET /health` |
|
||||
| `GET /api/v1/health/detailed` | ❌ No implementado | - |
|
||||
|
||||
## Endpoints Nuevos (No Documentados Originalmente)
|
||||
|
||||
| Endpoint | Descripción |
|
||||
|----------|-------------|
|
||||
| `POST /predict/tpsl` | Predicción TP/SL |
|
||||
| `GET /symbols` | Lista de símbolos |
|
||||
| `GET /api/signals/active` | Señales activas multi-símbolo |
|
||||
| `POST /api/amd/{symbol}` | Detección AMD |
|
||||
| `POST /api/ict/{symbol}` | Análisis ICT/SMC |
|
||||
| `POST /api/ensemble/{symbol}` | Señal ensemble |
|
||||
| `GET /api/ensemble/quick/{symbol}` | Señal rápida |
|
||||
| `POST /api/scan` | Scanner multi-símbolo |
|
||||
| `POST /api/backtest` | Backtesting |
|
||||
| `POST /api/train/full` | Entrenamiento |
|
||||
| `WS /ws/signals` | WebSocket tiempo real |
|
||||
|
||||
## Cambios Arquitectónicos
|
||||
|
||||
1. **Sin versionado de URL**: La API no usa `/api/v1/` en las rutas
|
||||
2. **Autenticación**: API Key via header aún no implementado (CORS abierto en dev)
|
||||
3. **Rate Limiting**: Pendiente de implementar
|
||||
4. **Símbolos soportados**: XAUUSD, EURUSD, GBPUSD, USDJPY, BTCUSD, ETHUSD (no BTCUSDT/ETHUSDT)
|
||||
|
||||
---
|
||||
|
||||
## Referencias
|
||||
|
||||
- [ET-ML-001: Arquitectura](./ET-ML-001-arquitectura.md)
|
||||
- [FastAPI Documentation](https://fastapi.tiangolo.com/)
|
||||
- [OpenAPI Specification](https://swagger.io/specification/)
|
||||
- **Código fuente**: `apps/ml-engine/src/api/main.py`
|
||||
|
||||
---
|
||||
|
||||
## Changelog
|
||||
|
||||
| Fecha | Versión | Cambio |
|
||||
|-------|---------|--------|
|
||||
| 2026-01-07 | 2.0.0 | Actualización completa con endpoints reales implementados |
|
||||
| 2026-01-07 | 2.0.0 | Separación en secciones IMPLEMENTADOS vs PLANIFICADOS |
|
||||
| 2026-01-07 | 2.0.0 | Documentación de 11 nuevos endpoints |
|
||||
| 2025-12-05 | 1.0.0 | Creación inicial con diseño planificado |
|
||||
|
||||
---
|
||||
|
||||
**Autor:** Requirements-Analyst / ML-Architect
|
||||
**Última actualización:** 2026-01-07
|
||||
**Autor:** Requirements-Analyst
|
||||
**Fecha:** 2025-12-05
|
||||
|
||||
@ -11,7 +11,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Fecha:** 2025-12-08
|
||||
**Proyecto:** Trading Platform
|
||||
**Proyecto:** OrbiQuant IA Trading Platform
|
||||
**Autor:** Requirements Analyst / Trading Strategist
|
||||
|
||||
---
|
||||
@ -479,4 +479,4 @@ Segun la politica de puertos del workspace, trading-platform usa el rango **3600
|
||||
---
|
||||
|
||||
**Documento Generado:** 2025-12-08
|
||||
**Requirements Analyst / Trading Strategist - Trading Platform**
|
||||
**Requirements Analyst / Trading Strategist - OrbiQuant IA**
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Version:** 2.0.0
|
||||
**Fecha:** 2025-12-08
|
||||
**Modulo:** OQI-006-ml-signals
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -952,7 +952,7 @@ def execute_trade(
|
||||
### System Prompt para LLM
|
||||
|
||||
```
|
||||
You are Trading Platform AI Trading Copilot, a specialized assistant for trading operations.
|
||||
You are OrbiQuant AI Trading Copilot, a specialized assistant for trading operations.
|
||||
|
||||
You have access to the following tools:
|
||||
1. get_ml_signal(symbol, timeframe) - Get ML-generated trading signals
|
||||
@ -979,4 +979,4 @@ Current market context:
|
||||
---
|
||||
|
||||
**Documento Generado:** 2025-12-08
|
||||
**Trading Strategist - Trading Platform**
|
||||
**Trading Strategist - OrbiQuant IA**
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Versi\u00f3n:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
**M\u00f3dulo:** OQI-006-ml-signals
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -1423,4 +1423,4 @@ elif current_phase['phase'] == 'manipulation':
|
||||
|
||||
**Documento Generado:** 2025-12-05
|
||||
**Pr\u00f3xima Revisi\u00f3n:** 2025-Q1
|
||||
**Contacto:** trading-strategist@trading.ai
|
||||
**Contacto:** trading-strategist@orbiquant.ai
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Versi\u00f3n:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
**M\u00f3dulo:** OQI-006-ml-signals
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -1274,4 +1274,4 @@ def label_with_confluence(df, i, forward_window=18):
|
||||
|
||||
**Documento Generado:** 2025-12-05
|
||||
**Pr\u00f3xima Revisi\u00f3n:** 2025-Q1
|
||||
**Contacto:** trading-strategist@trading.ai
|
||||
**Contacto:** trading-strategist@orbiquant.ai
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
---
|
||||
id: "FEATURES-TARGETS-COMPLETO"
|
||||
title: "Features y Targets Completos - Modelos ML Trading Platform"
|
||||
title: "Features y Targets Completos - Modelos ML OrbiQuant IA"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Features y Targets Completos - Modelos ML Trading Platform
|
||||
# Features y Targets Completos - Modelos ML OrbiQuant IA
|
||||
|
||||
**Version:** 2.0.0
|
||||
**Fecha:** 2025-12-08
|
||||
**Modulo:** OQI-006-ml-signals
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -990,4 +990,4 @@ def temporal_validation(model, X, y, n_splits=5):
|
||||
---
|
||||
|
||||
**Documento Generado:** 2025-12-08
|
||||
**Trading Strategist - Trading Platform**
|
||||
**Trading Strategist - OrbiQuant IA**
|
||||
|
||||
@ -12,7 +12,7 @@ updated_date: "2026-01-04"
|
||||
**Versi\u00f3n:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
**M\u00f3dulo:** OQI-006-ml-signals
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -33,7 +33,7 @@ updated_date: "2026-01-04"
|
||||
|
||||
## Introducci\u00f3n
|
||||
|
||||
Este documento define el cat\u00e1logo completo de features (variables de entrada) y targets (variables objetivo) utilizados en los modelos ML de Trading Platform.
|
||||
Este documento define el cat\u00e1logo completo de features (variables de entrada) y targets (variables objetivo) utilizados en los modelos ML de OrbiQuant IA.
|
||||
|
||||
### Dimensiones Totales
|
||||
|
||||
@ -875,4 +875,4 @@ def temporal_validation_split(df, train_pct=0.7, val_pct=0.15):
|
||||
|
||||
**Documento Generado:** 2025-12-05
|
||||
**Pr\u00f3xima Revisi\u00f3n:** 2025-Q1
|
||||
**Contacto:** ml-engineering@trading.ai
|
||||
**Contacto:** ml-engineering@orbiquant.ai
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
---
|
||||
id: "MODELOS-ML-DEFINICION"
|
||||
title: "Arquitectura de Modelos ML - Trading Platform"
|
||||
title: "Arquitectura de Modelos ML - OrbiQuant IA"
|
||||
type: "Documentation"
|
||||
project: "trading-platform"
|
||||
version: "1.0.0"
|
||||
updated_date: "2026-01-04"
|
||||
---
|
||||
|
||||
# Arquitectura de Modelos ML - Trading Platform
|
||||
# Arquitectura de Modelos ML - OrbiQuant IA
|
||||
|
||||
**Versi\u00f3n:** 1.0.0
|
||||
**Fecha:** 2025-12-05
|
||||
**M\u00f3dulo:** OQI-006-ml-signals
|
||||
**Autor:** Trading Strategist - Trading Platform
|
||||
**Autor:** Trading Strategist - OrbiQuant IA
|
||||
|
||||
---
|
||||
|
||||
@ -1600,7 +1600,7 @@ class SignalBacktester:
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
|
||||
app = FastAPI(title="Trading Platform ML Service")
|
||||
app = FastAPI(title="OrbiQuant ML Service")
|
||||
|
||||
# Load models
|
||||
orchestrator = StrategyOrchestrator.load('models/orchestrator_v1.pkl')
|
||||
@ -1718,4 +1718,4 @@ class AutoRetrainingPipeline:
|
||||
|
||||
**Documento Generado:** 2025-12-05
|
||||
**Pr\u00f3xima Revisi\u00f3n:** 2025-Q1
|
||||
**Contacto:** ml-engineering@trading.ai
|
||||
**Contacto:** ml-engineering@orbiquant.ai
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user