Add files using upload-large-folder tool
Browse files- .DS_Store +0 -0
- .gitignore +50 -0
- Dockerfile +41 -0
- README.md +369 -0
- backend.log +109 -0
- backend/node_modules/effect/src/internal/opCodes/cause.ts +35 -0
- backend/node_modules/effect/src/internal/opCodes/channel.ts +83 -0
- backend/node_modules/effect/src/internal/opCodes/channelMergeDecision.ts +11 -0
- backend/node_modules/effect/src/internal/opCodes/channelMergeStrategy.ts +11 -0
- backend/node_modules/effect/src/internal/opCodes/channelState.ts +23 -0
- backend/node_modules/effect/src/internal/opCodes/channelUpstreamPullRequest.ts +11 -0
- backend/node_modules/effect/src/internal/opCodes/config.ts +65 -0
- backend/node_modules/effect/src/internal/opCodes/configError.ts +35 -0
- backend/node_modules/effect/src/internal/opCodes/continuation.ts +11 -0
- backend/node_modules/effect/src/internal/opCodes/deferred.ts +11 -0
- backend/node_modules/effect/src/internal/opCodes/streamHaltStrategy.ts +23 -0
- docker-compose.yml +14 -0
- frontend.log +2 -0
- package-lock.json +0 -0
- package.json +35 -0
.DS_Store
ADDED
|
Binary file (12.3 kB). View file
|
|
|
.gitignore
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Node.js
|
| 2 |
+
node_modules/
|
| 3 |
+
npm-debug.log*
|
| 4 |
+
yarn-debug.log*
|
| 5 |
+
yarn-error.log*
|
| 6 |
+
package-lock.json
|
| 7 |
+
yarn.lock
|
| 8 |
+
|
| 9 |
+
# Entorno
|
| 10 |
+
.env
|
| 11 |
+
.env.local
|
| 12 |
+
.env.*.local
|
| 13 |
+
|
| 14 |
+
# Base de datos SQLite
|
| 15 |
+
*.db
|
| 16 |
+
*.db-journal
|
| 17 |
+
backend/prisma/dev.db
|
| 18 |
+
backend/prisma/dev.db-journal
|
| 19 |
+
|
| 20 |
+
# Logs
|
| 21 |
+
logs/
|
| 22 |
+
*.log
|
| 23 |
+
|
| 24 |
+
# macOS
|
| 25 |
+
.DS_Store
|
| 26 |
+
.AppleDouble
|
| 27 |
+
.LSOverride
|
| 28 |
+
._*
|
| 29 |
+
|
| 30 |
+
# Windows
|
| 31 |
+
Thumbs.db
|
| 32 |
+
ehthumbs.db
|
| 33 |
+
Desktop.ini
|
| 34 |
+
|
| 35 |
+
# IDEs y editores
|
| 36 |
+
.idea/
|
| 37 |
+
.vscode/
|
| 38 |
+
*.swp
|
| 39 |
+
*.swo
|
| 40 |
+
*~
|
| 41 |
+
|
| 42 |
+
# Coverage y testing
|
| 43 |
+
coverage/
|
| 44 |
+
.nyc_output/
|
| 45 |
+
|
| 46 |
+
# Docker
|
| 47 |
+
.dockerignore
|
| 48 |
+
|
| 49 |
+
# HuggingFace Spaces (si genera cache)
|
| 50 |
+
.cache/
|
Dockerfile
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile — PolySignal
|
| 2 |
+
#
|
| 3 |
+
# Estructura multicontexto:
|
| 4 |
+
# - backend/ : API Node.js + Express + Socket.io + Prisma
|
| 5 |
+
# - frontend/ : SPA Vanilla JS (servida como estaticos)
|
| 6 |
+
#
|
| 7 |
+
# Pasos:
|
| 8 |
+
# 1. Establecer WORKDIR en /app
|
| 9 |
+
# 2. Copiar e instalar dependencias del backend
|
| 10 |
+
# 3. Copiar e instalar dependencias del frontend y construir (vite build)
|
| 11 |
+
# 4. Copiar todo el codigo fuente del backend
|
| 12 |
+
# 5. Generar cliente Prisma para SQLite
|
| 13 |
+
# 6. Exponer puerto 7860 (requerido por HuggingFace Spaces)
|
| 14 |
+
# 7. Iniciar aplicacion con: node backend/src/index.js
|
| 15 |
+
#
|
| 16 |
+
# Build local: docker build -t polysignal .
|
| 17 |
+
# Run local: docker run -p 7860:7860 --env-file .env polysignal
|
| 18 |
+
|
| 19 |
+
FROM node:22-slim
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Instalar dependencias del backend
|
| 23 |
+
COPY backend/package*.json ./backend/
|
| 24 |
+
RUN cd backend && npm ci --only=production
|
| 25 |
+
|
| 26 |
+
# Instalar dependencias del frontend y construir
|
| 27 |
+
COPY frontend/package*.json ./frontend/
|
| 28 |
+
RUN cd frontend && npm ci
|
| 29 |
+
COPY frontend/ ./frontend/
|
| 30 |
+
RUN cd frontend && npm run build
|
| 31 |
+
|
| 32 |
+
# Copiar codigo fuente del backend
|
| 33 |
+
COPY backend/ ./backend/
|
| 34 |
+
|
| 35 |
+
# Generar cliente Prisma
|
| 36 |
+
RUN cd backend && npx prisma generate
|
| 37 |
+
|
| 38 |
+
# Puerto obligatorio de HuggingFace Spaces
|
| 39 |
+
EXPOSE 7860
|
| 40 |
+
|
| 41 |
+
CMD ["node", "backend/src/index.js"]
|
README.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PolySignal
|
| 2 |
+
|
| 3 |
+
Dashboard web de inteligencia de mercados de prediccion en tiempo real.
|
| 4 |
+
|
| 5 |
+
## Que es
|
| 6 |
+
|
| 7 |
+
PolySignal analiza mercados de Polymarket cruzando noticias de Finnhub con modelos de IA (ModernFinBERT + Qwen3-8B) para generar senales de trading (alcista, bajista, neutral). Incluye simulador de posiciones con capital virtual, lista de seguimiento y alertas por Telegram.
|
| 8 |
+
|
| 9 |
+
**No ejecuta ordenes reales.** Es una herramienta de analisis e inteligencia.
|
| 10 |
+
|
| 11 |
+
**Idioma:** Espanol.
|
| 12 |
+
**Moneda base:** Euro (€).
|
| 13 |
+
|
| 14 |
+
## Stack
|
| 15 |
+
|
| 16 |
+
- **Backend:** Node.js 26 + Express.js 5 + Socket.io + node-cron
|
| 17 |
+
- **ORM:** Prisma 6 + SQLite
|
| 18 |
+
- **Frontend:** Vanilla JS + Vite 7 + Leaflet.js + Chart.js + Socket.io client
|
| 19 |
+
- **IA:** HuggingFace Spaces (ModernFinBERT + Qwen3-8B) + OpenRouter fallback
|
| 20 |
+
- **Datos:** Polymarket Gamma API + Finnhub REST
|
| 21 |
+
- **Deploy:** HuggingFace Spaces (Docker, puerto 7860)
|
| 22 |
+
|
| 23 |
+
## Estado del proyecto
|
| 24 |
+
|
| 25 |
+
El backend es **totalmente funcional**:
|
| 26 |
+
|
| 27 |
+
- API REST completa con autenticacion JWT.
|
| 28 |
+
- Pipeline de IA con cadena de fallback (Spaces HF → API HF → OpenRouter → rule-based).
|
| 29 |
+
- Scheduler de tareas periodicas (sync mercados, generacion de senales, P&L, alertas).
|
| 30 |
+
- WebSocket en tiempo real para precios y senales.
|
| 31 |
+
- Base de datos SQLite con Prisma ORM
|
| 32 |
+
|
| 33 |
+
El frontend **consume datos reales del backend** y tiene **fallback a datos mock** cuando el backend no responde (modo demo sin configuracion).
|
| 34 |
+
|
| 35 |
+
## Mejoras de utilidad
|
| 36 |
+
|
| 37 |
+
Para que la app sea util mas alla de la demo visual, se han incorporado los siguientes ajustes — todos orientados a que las senales tengan *edge* real y no sean ruido bonito:
|
| 38 |
+
|
| 39 |
+
### 1. Fetch diversificado por tag (anti-monotonia)
|
| 40 |
+
|
| 41 |
+
El endpoint `/markets` de Polymarket ignora `tag_id` y siempre devuelve la home feed (politica US + World Cup). El cliente usa ahora el endpoint **`/events`** que SI respeta `tag_id`, con un catalogo curado de ~25 tags de alto valor (crypto-prices, fed, stock-market, tech, openai, middle-east, oil-industry, europe, taiwan-election, etc.) y aplana los mercados por tag.
|
| 42 |
+
|
| 43 |
+
Resultado: ~1000 mercados activos diarios distribuidos en 6 categorias (cripto, economia, geopolitica, ciencia, politica, entretenimiento) en lugar de los ~100 dominados por una unica categoria.
|
| 44 |
+
|
| 45 |
+
### 2. Whitelist de mercados analizables
|
| 46 |
+
|
| 47 |
+
`polymarket.client.js → isAnalyzable()` flaggea como **no analizables** los mercados donde la IA no tiene edge plausible:
|
| 48 |
+
|
| 49 |
+
- Predicciones de palabras (*"Will Trump say nuclear?"*)
|
| 50 |
+
- Views de YouTubers, recuentos de tweets
|
| 51 |
+
- "Before GTA VI"-style memes
|
| 52 |
+
- Deportes y entretenimiento
|
| 53 |
+
|
| 54 |
+
`signals.service.js` salta la generacion para estos mercados y el frontend pinta el badge **"FUERA DE ALCANCE"** en lugar de fabricar confianza falsa. Asi, cada senal visible es defendible.
|
| 55 |
+
|
| 56 |
+
### 3. Ground truth de cripto via CoinGecko
|
| 57 |
+
|
| 58 |
+
`utils/coingecko.client.js` resuelve spot prices (BTC, ETH, SOL, DOGE, ADA, XRP) y los inyecta en el prompt de la IA para mercados de precio objetivo:
|
| 59 |
+
|
| 60 |
+
```
|
| 61 |
+
GROUND TRUTH: BTC spot $103,400. Target $150,000 (+45.1% required).
|
| 62 |
+
Use this to judge whether the implied probability is plausible given typical volatility.
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
Cache TTL 60s — respeta el rate limit gratuito de CoinGecko.
|
| 66 |
+
|
| 67 |
+
### 4. Edge gap explicito (impliedProb vs fairProb)
|
| 68 |
+
|
| 69 |
+
Cada `AISignal` persiste ahora `impliedProb`, `fairProb` y `edgePoints`. El pipeline mapea `(signal, confidence) → fairProb`:
|
| 70 |
+
|
| 71 |
+
| Signal | Formula |
|
| 72 |
+
|--------|---------|
|
| 73 |
+
| bullish + conf 0.8 | fairProb = 0.5 + 0.8 × 0.5 = 0.90 |
|
| 74 |
+
| bearish + conf 0.8 | fairProb = 0.5 − 0.8 × 0.5 = 0.10 |
|
| 75 |
+
| neutral | fairProb = 0.5 |
|
| 76 |
+
|
| 77 |
+
La tarjeta del mercado muestra: `Mercado 65% · IA 78% · Edge +13pp` — claim cuantitativo en lugar de prosa vaga.
|
| 78 |
+
|
| 79 |
+
### 5. Spread-aware sizing (Kelly con costes)
|
| 80 |
+
|
| 81 |
+
Polymarket expone `spread`, `bestBid`, `bestAsk` por mercado. `positions/kelly.js → suggestSize()` resta el spread del edge bruto antes de calcular el tamano de posicion:
|
| 82 |
+
|
| 83 |
+
```
|
| 84 |
+
edgeNeto = |edgePoints/100| - spread
|
| 85 |
+
fraction = Quarter-Kelly(price, impliedProb + edgeNeto)
|
| 86 |
+
amount = bankroll * min(0.25, fraction)
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
Mercados con `spread > 5¢` se marcan como **ilíquidos** y los botones de compra se desactivan. Endpoint publico: `GET /api/v1/positions/suggestion/:marketId`.
|
| 90 |
+
|
| 91 |
+
### 6. Distribucion geografica del mapa
|
| 92 |
+
|
| 93 |
+
`map.js` usa **jitter determinista** (hash del marketId → desplazamiento en bounding-box del pais) para que multiples mercados del mismo pais no se apilen sobre la capital. Mercados sin pais (cripto, indices, AI) se reparten entre **40 hubs financieros** globales (NYC, Sao Paulo, Mumbai, Lagos, Moscu, Yakarta, Sydney, etc.) en vez de caer todos sobre [20,0].
|
| 94 |
+
|
| 95 |
+
## Estructura
|
| 96 |
+
|
| 97 |
+
```
|
| 98 |
+
polysignal/
|
| 99 |
+
├── backend/ # API REST + Servicios + Scheduler
|
| 100 |
+
│ ├── package.json
|
| 101 |
+
│ ├── prisma/
|
| 102 |
+
│ │ ├── schema.prisma # Schema SQLite (User, Market, AISignal, Position, Watchlist, Alert)
|
| 103 |
+
│ │ ├── migrations/ # Migraciones de Prisma
|
| 104 |
+
│ │ └── seed.js # Usuarios demo (admin + user)
|
| 105 |
+
│ └── src/
|
| 106 |
+
│ ├── index.js # Entry point: HTTP server + Socket.io + scheduler
|
| 107 |
+
│ ├── app.js # Express: middlewares + rutas + manejo de errores
|
| 108 |
+
│ ├── config.js # Variables de entorno validadas con Zod
|
| 109 |
+
│ ├── scheduler.js # Jobs periodicos (cron): sync, senales IA, PnL, alertas
|
| 110 |
+
│ ├── auth/ # Autenticacion JWT + bcrypt
|
| 111 |
+
│ │ ├── auth.controller.js
|
| 112 |
+
│ │ ├── auth.service.js
|
| 113 |
+
│ │ ├── auth.routes.js
|
| 114 |
+
│ │ ├── auth.validators.js
|
| 115 |
+
│ │ └── jwt.js
|
| 116 |
+
│ ├── markets/ # Mercados de Polymarket
|
| 117 |
+
│ │ ├── markets.controller.js
|
| 118 |
+
│ │ ├── markets.service.js
|
| 119 |
+
│ │ ├── markets.routes.js
|
| 120 |
+
│ │ ├── markets.validators.js
|
| 121 |
+
│ │ ├── markets.repository.js
|
| 122 |
+
│ │ └── polymarket.client.js
|
| 123 |
+
│ ├── signals/ # Pipeline de IA (ModernFinBERT + Qwen3-8B)
|
| 124 |
+
│ │ ├── signals.controller.js
|
| 125 |
+
│ │ ├── signals.service.js
|
| 126 |
+
│ │ ├── signals.routes.js
|
| 127 |
+
│ │ ├── signals.repository.js
|
| 128 |
+
│ │ ├── aiPipeline.js # Pipeline IA con fallback chain
|
| 129 |
+
│ │ └── finnhub.client.js # Noticias financieras
|
| 130 |
+
│ ├── positions/ # Simulador de posiciones virtuales
|
| 131 |
+
│ │ ├── positions.controller.js
|
| 132 |
+
│ │ ├── positions.service.js
|
| 133 |
+
│ │ ├── positions.routes.js
|
| 134 |
+
│ │ ├── positions.validators.js
|
| 135 |
+
│ │ ├── positions.repository.js
|
| 136 |
+
│ │ └── kelly.js # Criterio de Kelly (sizing)
|
| 137 |
+
│ ├── watchlist/ # Lista de seguimiento
|
| 138 |
+
│ │ ├── watchlist.controller.js
|
| 139 |
+
│ │ ├── watchlist.service.js
|
| 140 |
+
│ │ ├── watchlist.routes.js
|
| 141 |
+
│ │ ├── watchlist.validators.js
|
| 142 |
+
│ │ └── watchlist.repository.js
|
| 143 |
+
│ ├── alerts/ # Alertas por Telegram
|
| 144 |
+
│ │ ├── alerts.controller.js
|
| 145 |
+
│ │ ├── alerts.service.js
|
| 146 |
+
│ │ ├── alerts.routes.js
|
| 147 |
+
│ │ ├── alerts.repository.js
|
| 148 |
+
│ │ └── telegram.client.js
|
| 149 |
+
│ ├── middlewares/ # Middlewares reutilizables
|
| 150 |
+
│ │ ├── validate.js # Validacion Zod generica
|
| 151 |
+
│ │ ├── requireAuth.js # Autenticacion JWT
|
| 152 |
+
│ │ ├── rateLimitLogin.js # Rate limit login
|
| 153 |
+
│ │ ├── errorHandler.js # Manejo centralizado de errores
|
| 154 |
+
│ │ └── notFound.js # 404
|
| 155 |
+
│ ├── utils/ # Utilidades compartidas
|
| 156 |
+
│ │ ├── apiResponse.js # Helpers de respuesta HTTP
|
| 157 |
+
│ │ ├── httpClient.js # Cliente HTTP con retry + timeout
|
| 158 |
+
│ │ ├── logger.js # Pino (logs estructurados)
|
| 159 |
+
│ │ └── prisma.js # Singleton PrismaClient
|
| 160 |
+
│ └── socket/
|
| 161 |
+
│ └── broadcaster.js # Emisor de eventos Socket.io
|
| 162 |
+
│
|
| 163 |
+
├── frontend/ # SPA Vanilla JS con Vite
|
| 164 |
+
│ ├── index.html # Punto de entrada HTML
|
| 165 |
+
│ ├── package.json
|
| 166 |
+
│ ├── vite.config.js # Proxy a backend + build config
|
| 167 |
+
│ └── src/
|
| 168 |
+
│ ├── main.js # Entry point de Vite
|
| 169 |
+
│ ├── app.js # Logica principal SPA + Socket.io
|
| 170 |
+
│ ├── api.js # Cliente REST del backend
|
| 171 |
+
│ ├── charts.js # Chart.js (historial + sparklines)
|
| 172 |
+
│ ├── map.js # Leaflet (mapa mundial interactivo)
|
| 173 |
+
│ ├── simulator.js # Simulador de posiciones virtuales
|
| 174 |
+
│ └── style.css # Estilos dark terminal / fintech
|
| 175 |
+
│
|
| 176 |
+
├── spaces/ # HuggingFace Spaces (ZeroGPU)
|
| 177 |
+
│ ├── modernfinbert/ # Space de ModernFinBERT
|
| 178 |
+
│ │ ├── app.py
|
| 179 |
+
│ │ ├── requirements.txt
|
| 180 |
+
│ │ └── README.md
|
| 181 |
+
│ └── qwen3-8b/ # Space de Qwen3-8B
|
| 182 |
+
│ ├── app.py
|
| 183 |
+
│ ├── Dockerfile
|
| 184 |
+
│ ├── requirements.txt
|
| 185 |
+
│ └── README.md
|
| 186 |
+
│
|
| 187 |
+
├── package.json # Root con workspaces + scripts conjuntos
|
| 188 |
+
├── docker-compose.yml # Orquestacion local
|
| 189 |
+
├── Dockerfile # Build para HuggingFace Spaces
|
| 190 |
+
├── .env.example # Variables de entorno de ejemplo
|
| 191 |
+
├── SECURITY_HEALTHCHECK.md # Auditoria de seguridad y arquitectura
|
| 192 |
+
└── README.md
|
| 193 |
+
```
|
| 194 |
+
|
| 195 |
+
## Requisitos
|
| 196 |
+
|
| 197 |
+
- **Node.js >= 26.0.0**
|
| 198 |
+
- **npm >= 10** (workspaces)
|
| 199 |
+
|
| 200 |
+
## Instalacion rapida
|
| 201 |
+
|
| 202 |
+
```bash
|
| 203 |
+
# 1. Instalar dependencias (root + todos los workspaces)
|
| 204 |
+
npm install
|
| 205 |
+
|
| 206 |
+
# 2. Configurar variables de entorno
|
| 207 |
+
cp .env.example .env
|
| 208 |
+
# Editar .env con tus claves (HF_TOKEN, HF_SPACE_*, OPENROUTER_API_KEY, etc.)
|
| 209 |
+
|
| 210 |
+
# 3. Generar base de datos y cliente Prisma
|
| 211 |
+
npm run db:migrate
|
| 212 |
+
npm run db:generate
|
| 213 |
+
|
| 214 |
+
# 4. Iniciar en desarrollo
|
| 215 |
+
npm run dev:all # Backend + Frontend Vite simultaneamente
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
## Desarrollo solo frontend
|
| 219 |
+
|
| 220 |
+
Si solo quieres visualizar el dashboard (funciona con datos mock):
|
| 221 |
+
|
| 222 |
+
```bash
|
| 223 |
+
cd frontend
|
| 224 |
+
npm install
|
| 225 |
+
npm run dev
|
| 226 |
+
# Abrir http://localhost:5173
|
| 227 |
+
```
|
| 228 |
+
|
| 229 |
+
El frontend consume datos mock localmente cuando el backend no responde, por lo que el dashboard es totalmente funcional para la demo sin configuracion adicional.
|
| 230 |
+
|
| 231 |
+
## Arquitectura del Backend
|
| 232 |
+
|
| 233 |
+
El backend sigue una arquitectura **Layered (Controller → Service → Repository)**:
|
| 234 |
+
|
| 235 |
+
| Capa | Responsabilidad | Ejemplo |
|
| 236 |
+
|------|----------------|---------|
|
| 237 |
+
| **Controller** | Recibir HTTP request, delegar a Service, responder | `markets.controller.js` |
|
| 238 |
+
| **Service** | Logica de negocio, validaciones, coordinacion | `markets.service.js` |
|
| 239 |
+
| **Repository** | Acceso a datos via Prisma ORM | `markets.repository.js` |
|
| 240 |
+
| **Client** | Integracion con APIs externas | `polymarket.client.js`, `finnhub.client.js` |
|
| 241 |
+
| **Middleware** | Cross-cutting concerns (auth, validacion, rate limiting) | `requireAuth.js`, `validate.js` |
|
| 242 |
+
|
| 243 |
+
### Pipeline de IA
|
| 244 |
+
|
| 245 |
+
```
|
| 246 |
+
Whitelist analyzable (skip predicciones-de-palabras, sports, memes)
|
| 247 |
+
↓
|
| 248 |
+
Noticias (Finnhub) → relevantes por mercado
|
| 249 |
+
↓
|
| 250 |
+
Filtrado (ModernFinBERT Space / API directa)
|
| 251 |
+
↓ (descarta neutrales, score < 0.65)
|
| 252 |
+
Ground truth crypto (CoinGecko spot → solo si aplica)
|
| 253 |
+
↓
|
| 254 |
+
Generacion de senal (Qwen3-8B Space / API directa)
|
| 255 |
+
↓
|
| 256 |
+
Fallback: OpenRouter (deepseek-chat)
|
| 257 |
+
↓
|
| 258 |
+
Fallback: Rule-based (precio del mercado)
|
| 259 |
+
↓
|
| 260 |
+
Calculo edge: impliedProb vs fairProb → edgePoints
|
| 261 |
+
↓
|
| 262 |
+
Persistencia (SQLite) + Emision Socket.io
|
| 263 |
+
```
|
| 264 |
+
|
| 265 |
+
### Scheduler (node-cron)
|
| 266 |
+
|
| 267 |
+
| Job | Frecuencia | Descripcion |
|
| 268 |
+
|-----|-----------|-------------|
|
| 269 |
+
| syncMarkets | Cada 30s | Sincroniza precios + spread desde Polymarket Gamma (fetch diversificado por tag) |
|
| 270 |
+
| generateSignals | Cada 5 min | Genera senales IA para 40 mercados diversificados por categoria (solo analyzable=true) |
|
| 271 |
+
| updatePositionsPnL | Cada 30s | Recalcula P&L de posiciones abiertas |
|
| 272 |
+
| processAlerts | Cada 60s | Revisa watchlist y envia alertas Telegram |
|
| 273 |
+
|
| 274 |
+
## Arquitectura del Frontend
|
| 275 |
+
|
| 276 |
+
El frontend es una SPA construida con **Vite 7** como bundler y dev server.
|
| 277 |
+
|
| 278 |
+
### Caracteristicas visuales
|
| 279 |
+
|
| 280 |
+
- **Estetica dark terminal / fintech:** paleta `#0a0c10`, tipografias `Syne` + `DM Mono`.
|
| 281 |
+
- **Layout ajustable:** sidebar colapsable, paneles del dashboard colapsables individualmente.
|
| 282 |
+
- **Mapa global interactivo:** Leaflet con burbujas por pais (tamano = volumen, color = senal IA), jitter determinista para evitar apilamientos y 40 hubs financieros para mercados sin pais.
|
| 283 |
+
- **Panel de senales IA:** mercados con badges alcista/bajista/neutral, **fila de edge cuantitativa** (`Mercado X% · IA Y% · Edge ±N pp`) y badge **"FUERA DE ALCANCE"** para mercados no analizables.
|
| 284 |
+
- **Detalle de mercado:** sparklines, historial 7d, analisis IA, simulador de posiciones con **sugerencia de tamano Quarter-Kelly cost-aware** (servida por `GET /positions/suggestion/:marketId`) y deshabilitacion automatica para mercados con spread > 5¢.
|
| 285 |
+
- **Vistas adicionales:** Posiciones abiertas, Lista de seguimiento, Historial de alertas.
|
| 286 |
+
|
| 287 |
+
### Flujo de desarrollo
|
| 288 |
+
|
| 289 |
+
| Servicio | Comando | URL local |
|
| 290 |
+
|----------|---------|-----------|
|
| 291 |
+
| Backend (Express + Socket.io) | `npm run dev` | `http://localhost:7860` |
|
| 292 |
+
| Frontend (Vite + HMR) | `npm run dev:frontend` | `http://localhost:5173` |
|
| 293 |
+
| **Ambos a la vez** | **`npm run dev:all`** | — |
|
| 294 |
+
|
| 295 |
+
Vite esta configurado con un proxy que redirige automaticamente las peticiones a `/api` y `/socket.io` hacia el backend en el puerto `7860`, eliminando problemas de CORS durante el desarrollo local.
|
| 296 |
+
|
| 297 |
+
### Scripts disponibles
|
| 298 |
+
|
| 299 |
+
```bash
|
| 300 |
+
# Levantar solo el backend
|
| 301 |
+
npm run dev
|
| 302 |
+
|
| 303 |
+
# Levantar solo el frontend (Vite con hot reload)
|
| 304 |
+
npm run dev:frontend
|
| 305 |
+
|
| 306 |
+
# Levantar backend y frontend simultaneamente
|
| 307 |
+
npm run dev:all
|
| 308 |
+
|
| 309 |
+
# Build de produccion del frontend (genera frontend/dist/)
|
| 310 |
+
npm run build:frontend
|
| 311 |
+
|
| 312 |
+
# Preview del build de produccion
|
| 313 |
+
npm run preview:frontend
|
| 314 |
+
|
| 315 |
+
# Base de datos
|
| 316 |
+
npm run db:migrate # Crear/actualizar migraciones
|
| 317 |
+
npm run db:generate # Generar cliente Prisma
|
| 318 |
+
npm run db:studio # Explorar BD con Prisma Studio
|
| 319 |
+
```
|
| 320 |
+
|
| 321 |
+
## Deploy en HuggingFace Spaces
|
| 322 |
+
|
| 323 |
+
1. Crear Space tipo "Docker"
|
| 324 |
+
2. Subir codigo (`git push`)
|
| 325 |
+
3. Configurar Secrets en la interfaz de HF con las variables de `.env`
|
| 326 |
+
4. El contenedor expone el puerto 7860 automaticamente
|
| 327 |
+
|
| 328 |
+
### Docker local (opcional)
|
| 329 |
+
|
| 330 |
+
```bash
|
| 331 |
+
# Build y run con docker-compose
|
| 332 |
+
docker-compose up --build
|
| 333 |
+
|
| 334 |
+
# O solo docker build
|
| 335 |
+
docker build -t polysignal .
|
| 336 |
+
docker run -p 7860:7860 --env-file .env polysignal
|
| 337 |
+
```
|
| 338 |
+
|
| 339 |
+
## Variables de entorno
|
| 340 |
+
|
| 341 |
+
```env
|
| 342 |
+
# HuggingFace
|
| 343 |
+
HF_TOKEN= # API key de HuggingFace (Inference API)
|
| 344 |
+
HF_SPACE_MODERNFINBERT_URL= # URL del Space (ej: usuario/modernfinbert)
|
| 345 |
+
HF_SPACE_QWEN_URL= # URL del Space (ej: usuario/qwen3-8b)
|
| 346 |
+
|
| 347 |
+
# Fallbacks y datos
|
| 348 |
+
OPENROUTER_API_KEY= # Fallback LLM si HF esta saturado
|
| 349 |
+
FINNHUB_API_KEY= # Noticias financieras (finnhub.io)
|
| 350 |
+
|
| 351 |
+
# Alertas
|
| 352 |
+
TELEGRAM_BOT_TOKEN= # Bot de alertas (@BotFather)
|
| 353 |
+
|
| 354 |
+
# Base de datos y auth
|
| 355 |
+
DATABASE_URL=file:./backend/prisma/polysignal.db
|
| 356 |
+
JWT_SECRET=minimo-32-caracteres # Secreto para firmar JWT
|
| 357 |
+
|
| 358 |
+
# Servidor
|
| 359 |
+
PORT=7860 # Puerto requerido por HuggingFace Spaces
|
| 360 |
+
NODE_ENV=production # development | production
|
| 361 |
+
```
|
| 362 |
+
|
| 363 |
+
## Equipo
|
| 364 |
+
|
| 365 |
+
Hackathon CIFO Barcelona La Violeta — 13-18 mayo 2026
|
| 366 |
+
|
| 367 |
+
## Licencia
|
| 368 |
+
|
| 369 |
+
MIT
|
backend.log
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"level":30,"time":1779031483108,"pid":41416,"hostname":"Joses-Mac-mini-2.local","msg":"scheduler started"}
|
| 2 |
+
{"level":30,"time":1779031483112,"pid":41416,"hostname":"Joses-Mac-mini-2.local","port":7860,"env":"production","msg":"PolySignal backend up"}
|
| 3 |
+
{"level":30,"time":1779031483324,"pid":41416,"hostname":"Joses-Mac-mini-2.local","totalFetched":1083,"afterLiquidityFilter":985,"perCategory":{"cripto":273,"economía":64,"ciencia":207,"geopolítica":98,"política":239,"entretenimiento":104},"msg":"polymarket diversified fetch complete"}
|
| 4 |
+
{"level":30,"time":1779031484070,"pid":41416,"hostname":"Joses-Mac-mini-2.local","count":985,"msg":"markets synced"}
|
| 5 |
+
{"level":30,"time":1779031500027,"pid":41416,"hostname":"Joses-Mac-mini-2.local","total":40,"byCategory":{"cripto":8,"economía":7,"geopolítica":7,"política":6,"ciencia":5,"entretenimiento":3,"deportes":2,"general":2},"msg":"generating signals for diversified set"}
|
| 6 |
+
{"level":30,"time":1779031500030,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132768","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 7 |
+
{"level":30,"time":1779031500249,"pid":41416,"hostname":"Joses-Mac-mini-2.local","totalFetched":1083,"afterLiquidityFilter":985,"perCategory":{"cripto":273,"economía":64,"ciencia":207,"geopolítica":98,"política":239,"entretenimiento":104},"msg":"polymarket diversified fetch complete"}
|
| 8 |
+
{"level":30,"time":1779031500972,"pid":41416,"hostname":"Joses-Mac-mini-2.local","count":985,"msg":"markets synced"}
|
| 9 |
+
{"level":30,"time":1779031501456,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132768","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 10 |
+
{"level":30,"time":1779031510476,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132768","signal":"bearish","msg":"signal generated"}
|
| 11 |
+
{"level":30,"time":1779031510480,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558941","symbols":["ETH","COIN"],"keywords":["eth"],"msg":"Fetching company news for financial market"}
|
| 12 |
+
{"level":30,"time":1779031510626,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558941","count":13,"symbols":["ETH","COIN"],"msg":"Company news fetched"}
|
| 13 |
+
{"level":30,"time":1779031513438,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558941","signal":"bearish","msg":"signal generated"}
|
| 14 |
+
{"level":30,"time":1779031513439,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2268599","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 15 |
+
{"level":30,"time":1779031513439,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2268599","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 16 |
+
{"level":30,"time":1779031516107,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2268599","signal":"bearish","msg":"signal generated"}
|
| 17 |
+
{"level":30,"time":1779031516107,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132769","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 18 |
+
{"level":30,"time":1779031516107,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132769","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 19 |
+
{"level":30,"time":1779031519148,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132769","signal":"neutral","msg":"signal generated"}
|
| 20 |
+
{"level":30,"time":1779031519149,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132787","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 21 |
+
{"level":30,"time":1779031519149,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132787","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 22 |
+
{"level":30,"time":1779031521946,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132787","signal":"bearish","msg":"signal generated"}
|
| 23 |
+
{"level":30,"time":1779031521946,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132771","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 24 |
+
{"level":30,"time":1779031521947,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132771","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 25 |
+
{"level":30,"time":1779031525155,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132771","signal":"neutral","msg":"signal generated"}
|
| 26 |
+
{"level":30,"time":1779031525156,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132773","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 27 |
+
{"level":30,"time":1779031525156,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132773","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 28 |
+
{"level":30,"time":1779031528285,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132773","signal":"neutral","msg":"signal generated"}
|
| 29 |
+
{"level":30,"time":1779031528286,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132770","symbols":["BTC","COIN","MSTR","RIOT","MARA"],"keywords":["bitcoin"],"msg":"Fetching company news for financial market"}
|
| 30 |
+
{"level":30,"time":1779031528286,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132770","count":16,"symbols":["BTC","COIN","MSTR","RIOT","MARA"],"msg":"Company news fetched"}
|
| 31 |
+
{"level":30,"time":1779031530200,"pid":41416,"hostname":"Joses-Mac-mini-2.local","totalFetched":1083,"afterLiquidityFilter":985,"perCategory":{"cripto":273,"economía":64,"ciencia":207,"geopolítica":98,"política":239,"entretenimiento":104},"msg":"polymarket diversified fetch complete"}
|
| 32 |
+
{"level":30,"time":1779031530880,"pid":41416,"hostname":"Joses-Mac-mini-2.local","count":985,"msg":"markets synced"}
|
| 33 |
+
{"level":30,"time":1779031531563,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2132770","signal":"bearish","msg":"signal generated"}
|
| 34 |
+
{"level":30,"time":1779031531566,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906976","symbols":["TLT","TBT","DXY","SPY"],"keywords":["interest rate","fed"],"msg":"Fetching company news for financial market"}
|
| 35 |
+
{"level":30,"time":1779031532509,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906976","count":97,"symbols":["TLT","TBT","DXY","SPY"],"msg":"Company news fetched"}
|
| 36 |
+
{"level":30,"time":1779031535410,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906976","signal":"bearish","msg":"signal generated"}
|
| 37 |
+
{"level":30,"time":1779031535415,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906972","symbols":["TLT","TBT","DXY","SPY"],"keywords":["interest rate","fed"],"msg":"Fetching company news for financial market"}
|
| 38 |
+
{"level":30,"time":1779031535416,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906972","count":97,"symbols":["TLT","TBT","DXY","SPY"],"msg":"Company news fetched"}
|
| 39 |
+
{"level":30,"time":1779031538344,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906972","signal":"bearish","msg":"signal generated"}
|
| 40 |
+
{"level":30,"time":1779031538345,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906974","symbols":["TLT","TBT","DXY","SPY"],"keywords":["interest rate","fed"],"msg":"Fetching company news for financial market"}
|
| 41 |
+
{"level":30,"time":1779031538347,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906974","count":97,"symbols":["TLT","TBT","DXY","SPY"],"msg":"Company news fetched"}
|
| 42 |
+
{"level":30,"time":1779031541286,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906974","signal":"bearish","msg":"signal generated"}
|
| 43 |
+
{"level":30,"time":1779031541289,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906973","symbols":["TLT","TBT","DXY","SPY"],"keywords":["interest rate","fed"],"msg":"Fetching company news for financial market"}
|
| 44 |
+
{"level":30,"time":1779031541290,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906973","count":97,"symbols":["TLT","TBT","DXY","SPY"],"msg":"Company news fetched"}
|
| 45 |
+
{"level":30,"time":1779031543895,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906973","signal":"bearish","msg":"signal generated"}
|
| 46 |
+
{"level":30,"time":1779031543901,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906975","symbols":["TLT","TBT","DXY","SPY"],"keywords":["interest rate","fed"],"msg":"Fetching company news for financial market"}
|
| 47 |
+
{"level":30,"time":1779031543902,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906975","count":97,"symbols":["TLT","TBT","DXY","SPY"],"msg":"Company news fetched"}
|
| 48 |
+
{"level":30,"time":1779031546253,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"906975","signal":"bearish","msg":"signal generated"}
|
| 49 |
+
{"level":30,"time":1779031546254,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2278014","symbols":["FXE"],"keywords":["euro"],"msg":"Fetching company news for financial market"}
|
| 50 |
+
{"level":30,"time":1779031546399,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2278014","count":11,"symbols":["FXE"],"msg":"Company news fetched"}
|
| 51 |
+
{"level":30,"time":1779031548943,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2278014","signal":"neutral","msg":"signal generated"}
|
| 52 |
+
{"level":30,"time":1779031548943,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"616913","symbols":["TLT","SPY","QQQ","DXY"],"keywords":["rate cut","fed"],"msg":"Fetching company news for financial market"}
|
| 53 |
+
{"level":30,"time":1779031549126,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"616913","count":98,"symbols":["TLT","SPY","QQQ","DXY"],"msg":"Company news fetched"}
|
| 54 |
+
{"level":30,"time":1779031551796,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"616913","signal":"bearish","msg":"signal generated"}
|
| 55 |
+
{"level":30,"time":1779031551797,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558959","symbols":["USO","GLD","LMT"],"keywords":["iran"],"msg":"Fetching company news for financial market"}
|
| 56 |
+
{"level":30,"time":1779031552281,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558959","count":24,"symbols":["USO","GLD","LMT"],"msg":"Company news fetched"}
|
| 57 |
+
{"level":30,"time":1779031555608,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558959","signal":"bearish","msg":"signal generated"}
|
| 58 |
+
{"level":30,"time":1779031555609,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558945","symbols":["FXI","SPY"],"keywords":["xi"],"msg":"Fetching company news for financial market"}
|
| 59 |
+
{"level":30,"time":1779031555766,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558945","count":95,"symbols":["FXI","SPY"],"msg":"Company news fetched"}
|
| 60 |
+
{"level":30,"time":1779031558414,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"558945","signal":"bearish","msg":"signal generated"}
|
| 61 |
+
{"level":30,"time":1779031558415,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"567621","symbols":["NVDA","MSFT","GOOGL","META","FXI","USO","SPY","TSM","LMT"],"keywords":["ai","china","taiwan"],"msg":"Fetching company news for financial market"}
|
| 62 |
+
{"level":30,"time":1779031558987,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"567621","count":187,"symbols":["NVDA","MSFT","GOOGL","META","FXI","USO","SPY","TSM","LMT"],"msg":"Company news fetched"}
|
| 63 |
+
{"level":30,"time":1779031560197,"pid":41416,"hostname":"Joses-Mac-mini-2.local","totalFetched":1083,"afterLiquidityFilter":985,"perCategory":{"cripto":273,"economía":64,"ciencia":207,"geopolítica":98,"política":239,"entretenimiento":104},"msg":"polymarket diversified fetch complete"}
|
| 64 |
+
{"level":30,"time":1779031560815,"pid":41416,"hostname":"Joses-Mac-mini-2.local","count":985,"msg":"markets synced"}
|
| 65 |
+
{"level":30,"time":1779031561769,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"567621","signal":"neutral","msg":"signal generated"}
|
| 66 |
+
{"level":30,"time":1779031561772,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"1707932","symbols":["USO","GLD","LMT"],"keywords":["iran"],"msg":"Fetching company news for financial market"}
|
| 67 |
+
{"level":30,"time":1779031561773,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"1707932","count":24,"symbols":["USO","GLD","LMT"],"msg":"Company news fetched"}
|
| 68 |
+
{"level":30,"time":1779031564497,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"1707932","signal":"bullish","msg":"signal generated"}
|
| 69 |
+
{"level":30,"time":1779031564501,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"1919425","symbols":["USO","GLD","LMT"],"keywords":["iran"],"msg":"Fetching company news for financial market"}
|
| 70 |
+
{"level":30,"time":1779031564641,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"1919425","count":24,"symbols":["USO","GLD","LMT"],"msg":"Company news fetched"}
|
| 71 |
+
{"level":30,"time":1779031567356,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"1919425","signal":"bearish","msg":"signal generated"}
|
| 72 |
+
{"level":30,"time":1779031567357,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"665374","symbols":["USO","GLD","LMT"],"keywords":["iran"],"msg":"Fetching company news for financial market"}
|
| 73 |
+
{"level":30,"time":1779031567357,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"665374","count":24,"symbols":["USO","GLD","LMT"],"msg":"Company news fetched"}
|
| 74 |
+
{"level":30,"time":1779031570402,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"665374","signal":"neutral","msg":"signal generated"}
|
| 75 |
+
{"level":30,"time":1779031570407,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2155052","symbols":["USO","GLD","LMT"],"keywords":["iran"],"msg":"Fetching company news for financial market"}
|
| 76 |
+
{"level":30,"time":1779031570408,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2155052","count":24,"symbols":["USO","GLD","LMT"],"msg":"Company news fetched"}
|
| 77 |
+
{"level":30,"time":1779031573131,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2155052","signal":"neutral","msg":"signal generated"}
|
| 78 |
+
{"level":30,"time":1779031573135,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"561263","symbols":["SPY","DXY","VIX","XLE","GLD"],"keywords":["trump","election","presidential election"],"msg":"Fetching company news for financial market"}
|
| 79 |
+
{"level":30,"time":1779031573732,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"561263","count":38,"symbols":["SPY","DXY","VIX","XLE","GLD"],"msg":"Company news fetched"}
|
| 80 |
+
{"level":30,"time":1779031576601,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"561263","signal":"bearish","msg":"signal generated"}
|
| 81 |
+
{"level":30,"time":1779031576601,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2190153","symbols":["SPY","DXY","VIX","XLE"],"keywords":["trump"],"msg":"Fetching company news for financial market"}
|
| 82 |
+
{"level":30,"time":1779031576602,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2190153","count":37,"symbols":["SPY","DXY","VIX","XLE"],"msg":"Company news fetched"}
|
| 83 |
+
{"level":30,"time":1779031586224,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"2190153","signal":"bullish","msg":"signal generated"}
|
| 84 |
+
{"level":30,"time":1779031586224,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559690","symbols":["SPY","TLT"],"keywords":["democrat"],"msg":"Fetching company news for financial market"}
|
| 85 |
+
{"level":30,"time":1779031586373,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559690","count":42,"symbols":["SPY","TLT"],"msg":"Company news fetched"}
|
| 86 |
+
{"level":30,"time":1779031589382,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559690","signal":"bearish","msg":"signal generated"}
|
| 87 |
+
{"level":30,"time":1779031589382,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559681","symbols":["SPY","TLT"],"keywords":["democrat"],"msg":"Fetching company news for financial market"}
|
| 88 |
+
{"level":30,"time":1779031589382,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559681","count":42,"symbols":["SPY","TLT"],"msg":"Company news fetched"}
|
| 89 |
+
{"level":30,"time":1779031590201,"pid":41416,"hostname":"Joses-Mac-mini-2.local","totalFetched":1083,"afterLiquidityFilter":985,"perCategory":{"cripto":273,"economía":64,"ciencia":207,"geopolítica":98,"política":239,"entretenimiento":104},"msg":"polymarket diversified fetch complete"}
|
| 90 |
+
{"level":30,"time":1779031590850,"pid":41416,"hostname":"Joses-Mac-mini-2.local","count":985,"msg":"markets synced"}
|
| 91 |
+
{"level":30,"time":1779031592567,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559681","signal":"bearish","msg":"signal generated"}
|
| 92 |
+
{"level":30,"time":1779031592570,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559685","symbols":["SPY","TLT"],"keywords":["democrat"],"msg":"Fetching company news for financial market"}
|
| 93 |
+
{"level":30,"time":1779031592570,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559685","count":42,"symbols":["SPY","TLT"],"msg":"Company news fetched"}
|
| 94 |
+
{"level":30,"time":1779031595458,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559685","signal":"bearish","msg":"signal generated"}
|
| 95 |
+
{"level":30,"time":1779031595462,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559682","symbols":["SPY","DXY","VIX","TLT"],"keywords":["biden","democrat"],"msg":"Fetching company news for financial market"}
|
| 96 |
+
{"level":30,"time":1779031595607,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559682","count":43,"symbols":["SPY","DXY","VIX","TLT"],"msg":"Company news fetched"}
|
| 97 |
+
{"level":30,"time":1779031601635,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"559682","signal":"bearish","msg":"signal generated"}
|
| 98 |
+
{"level":30,"time":1779031601637,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631187","symbols":["AMZN"],"keywords":["amazon"],"msg":"Fetching company news for financial market"}
|
| 99 |
+
{"level":30,"time":1779031601780,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631187","count":47,"symbols":["AMZN"],"msg":"Company news fetched"}
|
| 100 |
+
{"level":30,"time":1779031604555,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631187","signal":"bearish","msg":"signal generated"}
|
| 101 |
+
{"level":30,"time":1779031604558,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631185","symbols":["TSLA"],"keywords":["tesla"],"msg":"Fetching company news for financial market"}
|
| 102 |
+
{"level":30,"time":1779031604759,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631185","count":86,"symbols":["TSLA"],"msg":"Company news fetched"}
|
| 103 |
+
{"level":30,"time":1779031607455,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631185","signal":"bearish","msg":"signal generated"}
|
| 104 |
+
{"level":30,"time":1779031607455,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631186","symbols":["USO","XLE"],"keywords":["saudi"],"msg":"Fetching company news for financial market"}
|
| 105 |
+
{"level":30,"time":1779031607725,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631186","count":16,"symbols":["USO","XLE"],"msg":"Company news fetched"}
|
| 106 |
+
{"level":30,"time":1779031610663,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631186","signal":"bearish","msg":"signal generated"}
|
| 107 |
+
{"level":30,"time":1779031610663,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631182","symbols":["MSFT"],"keywords":["microsoft"],"msg":"Fetching company news for financial market"}
|
| 108 |
+
{"level":30,"time":1779031610881,"pid":41416,"hostname":"Joses-Mac-mini-2.local","marketId":"631182","count":45,"symbols":["MSFT"],"msg":"Company news fetched"}
|
| 109 |
+
{"level":30,"time":1779031613467,"pid":41416,"hostname":"Joses-Mac-mini-2.local","sig":"SIGTERM","msg":"shutting down"}
|
backend/node_modules/effect/src/internal/opCodes/cause.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_DIE = "Die" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_DIE = typeof OP_DIE
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_EMPTY = "Empty" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_EMPTY = typeof OP_EMPTY
|
| 12 |
+
|
| 13 |
+
/** @internal */
|
| 14 |
+
export const OP_FAIL = "Fail" as const
|
| 15 |
+
|
| 16 |
+
/** @internal */
|
| 17 |
+
export type OP_FAIL = typeof OP_FAIL
|
| 18 |
+
|
| 19 |
+
/** @internal */
|
| 20 |
+
export const OP_INTERRUPT = "Interrupt" as const
|
| 21 |
+
|
| 22 |
+
/** @internal */
|
| 23 |
+
export type OP_INTERRUPT = typeof OP_INTERRUPT
|
| 24 |
+
|
| 25 |
+
/** @internal */
|
| 26 |
+
export const OP_PARALLEL = "Parallel" as const
|
| 27 |
+
|
| 28 |
+
/** @internal */
|
| 29 |
+
export type OP_PARALLEL = typeof OP_PARALLEL
|
| 30 |
+
|
| 31 |
+
/** @internal */
|
| 32 |
+
export const OP_SEQUENTIAL = "Sequential" as const
|
| 33 |
+
|
| 34 |
+
/** @internal */
|
| 35 |
+
export type OP_SEQUENTIAL = typeof OP_SEQUENTIAL
|
backend/node_modules/effect/src/internal/opCodes/channel.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_BRACKET_OUT = "BracketOut" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_BRACKET_OUT = typeof OP_BRACKET_OUT
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_BRIDGE = "Bridge" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_BRIDGE = typeof OP_BRIDGE
|
| 12 |
+
|
| 13 |
+
/** @internal */
|
| 14 |
+
export const OP_CONCAT_ALL = "ConcatAll" as const
|
| 15 |
+
|
| 16 |
+
/** @internal */
|
| 17 |
+
export type OP_CONCAT_ALL = typeof OP_CONCAT_ALL
|
| 18 |
+
|
| 19 |
+
/** @internal */
|
| 20 |
+
export const OP_EMIT = "Emit" as const
|
| 21 |
+
|
| 22 |
+
/** @internal */
|
| 23 |
+
export type OP_EMIT = typeof OP_EMIT
|
| 24 |
+
|
| 25 |
+
/** @internal */
|
| 26 |
+
export const OP_ENSURING = "Ensuring" as const
|
| 27 |
+
|
| 28 |
+
/** @internal */
|
| 29 |
+
export type OP_ENSURING = typeof OP_ENSURING
|
| 30 |
+
|
| 31 |
+
/** @internal */
|
| 32 |
+
export const OP_FAIL = "Fail" as const
|
| 33 |
+
|
| 34 |
+
/** @internal */
|
| 35 |
+
export type OP_FAIL = typeof OP_FAIL
|
| 36 |
+
|
| 37 |
+
/** @internal */
|
| 38 |
+
export const OP_FOLD = "Fold" as const
|
| 39 |
+
|
| 40 |
+
/** @internal */
|
| 41 |
+
export type OP_FOLD = typeof OP_FOLD
|
| 42 |
+
|
| 43 |
+
/** @internal */
|
| 44 |
+
export const OP_FROM_EFFECT = "FromEffect" as const
|
| 45 |
+
|
| 46 |
+
/** @internal */
|
| 47 |
+
export type OP_FROM_EFFECT = typeof OP_FROM_EFFECT
|
| 48 |
+
|
| 49 |
+
/** @internal */
|
| 50 |
+
export const OP_PIPE_TO = "PipeTo" as const
|
| 51 |
+
|
| 52 |
+
/** @internal */
|
| 53 |
+
export type OP_PIPE_TO = typeof OP_PIPE_TO
|
| 54 |
+
|
| 55 |
+
/** @internal */
|
| 56 |
+
export const OP_PROVIDE = "Provide" as const
|
| 57 |
+
|
| 58 |
+
/** @internal */
|
| 59 |
+
export type OP_PROVIDE = typeof OP_PROVIDE
|
| 60 |
+
|
| 61 |
+
/** @internal */
|
| 62 |
+
export const OP_READ = "Read" as const
|
| 63 |
+
|
| 64 |
+
/** @internal */
|
| 65 |
+
export type OP_READ = typeof OP_READ
|
| 66 |
+
|
| 67 |
+
/** @internal */
|
| 68 |
+
export const OP_SUCCEED = "Succeed" as const
|
| 69 |
+
|
| 70 |
+
/** @internal */
|
| 71 |
+
export type OP_SUCCEED = typeof OP_SUCCEED
|
| 72 |
+
|
| 73 |
+
/** @internal */
|
| 74 |
+
export const OP_SUCCEED_NOW = "SucceedNow" as const
|
| 75 |
+
|
| 76 |
+
/** @internal */
|
| 77 |
+
export type OP_SUCCEED_NOW = typeof OP_SUCCEED_NOW
|
| 78 |
+
|
| 79 |
+
/** @internal */
|
| 80 |
+
export const OP_SUSPEND = "Suspend" as const
|
| 81 |
+
|
| 82 |
+
/** @internal */
|
| 83 |
+
export type OP_SUSPEND = typeof OP_SUSPEND
|
backend/node_modules/effect/src/internal/opCodes/channelMergeDecision.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_DONE = "Done" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_DONE = typeof OP_DONE
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_AWAIT = "Await" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_AWAIT = typeof OP_AWAIT
|
backend/node_modules/effect/src/internal/opCodes/channelMergeStrategy.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_BACK_PRESSURE = "BackPressure" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_BACK_PRESSURE = typeof OP_BACK_PRESSURE
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_BUFFER_SLIDING = "BufferSliding" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_BUFFER_SLIDING = typeof OP_BUFFER_SLIDING
|
backend/node_modules/effect/src/internal/opCodes/channelState.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_DONE = "Done" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_DONE = typeof OP_DONE
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_EMIT = "Emit" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_EMIT = typeof OP_EMIT
|
| 12 |
+
|
| 13 |
+
/** @internal */
|
| 14 |
+
export const OP_FROM_EFFECT = "FromEffect" as const
|
| 15 |
+
|
| 16 |
+
/** @internal */
|
| 17 |
+
export type OP_FROM_EFFECT = typeof OP_FROM_EFFECT
|
| 18 |
+
|
| 19 |
+
/** @internal */
|
| 20 |
+
export const OP_READ = "Read" as const
|
| 21 |
+
|
| 22 |
+
/** @internal */
|
| 23 |
+
export type OP_READ = typeof OP_READ
|
backend/node_modules/effect/src/internal/opCodes/channelUpstreamPullRequest.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_PULLED = "Pulled" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_PULLED = typeof OP_PULLED
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_NO_UPSTREAM = "NoUpstream" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_NO_UPSTREAM = typeof OP_NO_UPSTREAM
|
backend/node_modules/effect/src/internal/opCodes/config.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export type OP_CONSTANT = typeof OP_CONSTANT
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export const OP_CONSTANT = "Constant" as const
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export type OP_FAIL = typeof OP_FAIL
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export const OP_FAIL = "Fail" as const
|
| 12 |
+
|
| 13 |
+
/** @internal */
|
| 14 |
+
export type OP_FALLBACK = typeof OP_FALLBACK
|
| 15 |
+
|
| 16 |
+
/** @internal */
|
| 17 |
+
export const OP_FALLBACK = "Fallback" as const
|
| 18 |
+
|
| 19 |
+
/** @internal */
|
| 20 |
+
export type OP_DESCRIBED = typeof OP_DESCRIBED
|
| 21 |
+
|
| 22 |
+
/** @internal */
|
| 23 |
+
export const OP_DESCRIBED = "Described" as const
|
| 24 |
+
|
| 25 |
+
/** @internal */
|
| 26 |
+
export type OP_LAZY = typeof OP_LAZY
|
| 27 |
+
|
| 28 |
+
/** @internal */
|
| 29 |
+
export const OP_LAZY = "Lazy" as const
|
| 30 |
+
|
| 31 |
+
/** @internal */
|
| 32 |
+
export type OP_MAP_OR_FAIL = typeof OP_MAP_OR_FAIL
|
| 33 |
+
|
| 34 |
+
/** @internal */
|
| 35 |
+
export const OP_MAP_OR_FAIL = "MapOrFail" as const
|
| 36 |
+
|
| 37 |
+
/** @internal */
|
| 38 |
+
export type OP_NESTED = typeof OP_NESTED
|
| 39 |
+
|
| 40 |
+
/** @internal */
|
| 41 |
+
export const OP_NESTED = "Nested" as const
|
| 42 |
+
|
| 43 |
+
/** @internal */
|
| 44 |
+
export type OP_PRIMITIVE = typeof OP_PRIMITIVE
|
| 45 |
+
|
| 46 |
+
/** @internal */
|
| 47 |
+
export const OP_PRIMITIVE = "Primitive" as const
|
| 48 |
+
|
| 49 |
+
/** @internal */
|
| 50 |
+
export type OP_SEQUENCE = typeof OP_SEQUENCE
|
| 51 |
+
|
| 52 |
+
/** @internal */
|
| 53 |
+
export const OP_SEQUENCE = "Sequence" as const
|
| 54 |
+
|
| 55 |
+
/** @internal */
|
| 56 |
+
export type OP_HASHMAP = typeof OP_HASHMAP
|
| 57 |
+
|
| 58 |
+
/** @internal */
|
| 59 |
+
export const OP_HASHMAP = "HashMap" as const
|
| 60 |
+
|
| 61 |
+
/** @internal */
|
| 62 |
+
export type OP_ZIP_WITH = typeof OP_ZIP_WITH
|
| 63 |
+
|
| 64 |
+
/** @internal */
|
| 65 |
+
export const OP_ZIP_WITH = "ZipWith" as const
|
backend/node_modules/effect/src/internal/opCodes/configError.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export type OP_AND = typeof OP_AND
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export const OP_AND = "And" as const
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export type OP_OR = typeof OP_OR
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export const OP_OR = "Or" as const
|
| 12 |
+
|
| 13 |
+
/** @internal */
|
| 14 |
+
export type OP_INVALID_DATA = typeof OP_INVALID_DATA
|
| 15 |
+
|
| 16 |
+
/** @internal */
|
| 17 |
+
export const OP_INVALID_DATA = "InvalidData" as const
|
| 18 |
+
|
| 19 |
+
/** @internal */
|
| 20 |
+
export type OP_MISSING_DATA = typeof OP_MISSING_DATA
|
| 21 |
+
|
| 22 |
+
/** @internal */
|
| 23 |
+
export const OP_MISSING_DATA = "MissingData" as const
|
| 24 |
+
|
| 25 |
+
/** @internal */
|
| 26 |
+
export type OP_SOURCE_UNAVAILABLE = typeof OP_SOURCE_UNAVAILABLE
|
| 27 |
+
|
| 28 |
+
/** @internal */
|
| 29 |
+
export const OP_SOURCE_UNAVAILABLE = "SourceUnavailable" as const
|
| 30 |
+
|
| 31 |
+
/** @internal */
|
| 32 |
+
export type OP_UNSUPPORTED = typeof OP_UNSUPPORTED
|
| 33 |
+
|
| 34 |
+
/** @internal */
|
| 35 |
+
export const OP_UNSUPPORTED = "Unsupported" as const
|
backend/node_modules/effect/src/internal/opCodes/continuation.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_CONTINUATION_K = "ContinuationK" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_CONTINUATION_K = typeof OP_CONTINUATION_K
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_CONTINUATION_FINALIZER = "ContinuationFinalizer" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_CONTINUATION_FINALIZER = typeof OP_CONTINUATION_FINALIZER
|
backend/node_modules/effect/src/internal/opCodes/deferred.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_STATE_PENDING = "Pending" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_STATE_PENDING = typeof OP_STATE_PENDING
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_STATE_DONE = "Done" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_STATE_DONE = typeof OP_STATE_DONE
|
backend/node_modules/effect/src/internal/opCodes/streamHaltStrategy.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/** @internal */
|
| 2 |
+
export const OP_LEFT = "Left" as const
|
| 3 |
+
|
| 4 |
+
/** @internal */
|
| 5 |
+
export type OP_LEFT = typeof OP_LEFT
|
| 6 |
+
|
| 7 |
+
/** @internal */
|
| 8 |
+
export const OP_RIGHT = "Right" as const
|
| 9 |
+
|
| 10 |
+
/** @internal */
|
| 11 |
+
export type OP_RIGHT = typeof OP_RIGHT
|
| 12 |
+
|
| 13 |
+
/** @internal */
|
| 14 |
+
export const OP_BOTH = "Both" as const
|
| 15 |
+
|
| 16 |
+
/** @internal */
|
| 17 |
+
export type OP_BOTH = typeof OP_BOTH
|
| 18 |
+
|
| 19 |
+
/** @internal */
|
| 20 |
+
export const OP_EITHER = "Either" as const
|
| 21 |
+
|
| 22 |
+
/** @internal */
|
| 23 |
+
export type OP_EITHER = typeof OP_EITHER
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: '3.8'
|
| 2 |
+
|
| 3 |
+
services:
|
| 4 |
+
backend:
|
| 5 |
+
build:
|
| 6 |
+
context: .
|
| 7 |
+
dockerfile: Dockerfile
|
| 8 |
+
ports:
|
| 9 |
+
- "7860:7860"
|
| 10 |
+
env_file:
|
| 11 |
+
- .env
|
| 12 |
+
volumes:
|
| 13 |
+
- ./backend/prisma:/app/backend/prisma
|
| 14 |
+
restart: unless-stopped
|
frontend.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
➜ Local: http://localhost:5173/
|
| 2 |
+
➜ Network: use --host to expose
|
package-lock.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "polysignal",
|
| 3 |
+
"version": "1.0.0",
|
| 4 |
+
"description": "Dashboard web de inteligencia de mercados de prediccion en tiempo real — Hackathon CIFO Barcelona La Violeta",
|
| 5 |
+
"private": true,
|
| 6 |
+
"workspaces": [
|
| 7 |
+
"backend",
|
| 8 |
+
"frontend"
|
| 9 |
+
],
|
| 10 |
+
"scripts": {
|
| 11 |
+
"start": "npm run start --workspace=backend",
|
| 12 |
+
"dev": "npm run dev --workspace=backend",
|
| 13 |
+
"dev:frontend": "npm run dev --workspace=frontend",
|
| 14 |
+
"dev:all": "concurrently \"npm run dev --workspace=backend\" \"npm run dev --workspace=frontend\"",
|
| 15 |
+
"build:frontend": "npm run build --workspace=frontend",
|
| 16 |
+
"preview:frontend": "npm run preview --workspace=frontend",
|
| 17 |
+
"db:migrate": "npm run db:migrate --workspace=backend",
|
| 18 |
+
"db:generate": "npm run db:generate --workspace=backend",
|
| 19 |
+
"db:studio": "npm run db:studio --workspace=backend"
|
| 20 |
+
},
|
| 21 |
+
"engines": {
|
| 22 |
+
"node": ">=24.0.0"
|
| 23 |
+
},
|
| 24 |
+
"keywords": [
|
| 25 |
+
"polymarket",
|
| 26 |
+
"prediction-markets",
|
| 27 |
+
"ai",
|
| 28 |
+
"hackathon"
|
| 29 |
+
],
|
| 30 |
+
"author": "Equipo PolySignal",
|
| 31 |
+
"license": "MIT",
|
| 32 |
+
"devDependencies": {
|
| 33 |
+
"concurrently": "^9.2.1"
|
| 34 |
+
}
|
| 35 |
+
}
|