Phase 5: Cross-Chain Memory Synchronization - Unified memory schema (ImmortalMemory) for all platforms * Works across PancakeSwap, Polymarket, cross-chain * Rich metadata: AI reasoning, market conditions, learning * Cross-chain relationship tracking - Unified memory storage system with advanced features: * Batch upload to Greenfield (configurable size) * Advanced query system with filters * Comprehensive analytics engine * Real-time sync status monitoring * Automated insights generation - Memory API endpoints (5 new): * GET /api/memory/analytics - Comprehensive stats * POST /api/memory/query - Advanced filtering * GET /api/memory/sync-status - Real-time status * POST /api/memory/force-sync - Manual trigger * POST /api/memory/store - Store new memory - Analytics capabilities: * Per-platform and per-chain breakdown * Time-based performance (24h, 7d, 30d) * AI agent performance comparison * Automated recommendations Phase 6: AI Orchestrator - Intelligent AI agent routing system: * TypeScript agent for fast DEX trades * Python agent for complex Polymarket analysis * Hybrid approach for cross-chain arbitrage * Urgency and research-based routing - Decision making system: * Unified decision format * Confidence scoring * Risk level calculation * Strategy tracking - Performance tracking: * Per-agent metrics (latency, accuracy) * Continuous learning from outcomes * Agent recommendation based on performance - Orchestrator API endpoints (3 new): * POST /api/orchestrator/decision - Get AI decision * GET /api/orchestrator/metrics - Performance metrics * POST /api/orchestrator/outcome - Record for learning Phase 7 (Started): Docker Compose - Multi-service orchestration configuration - Services: python-api, backend, frontend - Health checks and auto-restart policies - Shared network and log volumes - Production-ready configuration Files Created: - src/types/unifiedMemory.ts (unified schema) - src/blockchain/unifiedMemoryStorage.ts (storage system) - src/ai/orchestrator.ts (AI routing) - docker-compose.yml (multi-service deployment) Documentation: PHASE_5_6_COMPLETE.md Progress: ~75% complete (Phases 1-6 done, Phase 7 started) Next: Phase 7 completion (Security + Testing + CI/CD)
110 lines
3.2 KiB
YAML
110 lines
3.2 KiB
YAML
# Docker Compose configuration for Immortal AI Trading Bot
|
|
# Multi-service orchestration: Frontend + TypeScript Backend + Python Microservice
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
# ============================================================================
|
|
# Python Microservice (Polymarket AI Agents)
|
|
# ============================================================================
|
|
python-api:
|
|
build:
|
|
context: ./agents
|
|
dockerfile: Dockerfile
|
|
container_name: immortal-python-api
|
|
ports:
|
|
- "5000:5000"
|
|
environment:
|
|
- API_HOST=0.0.0.0
|
|
- API_PORT=5000
|
|
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
|
- POLYGON_WALLET_PRIVATE_KEY=${POLYGON_WALLET_PRIVATE_KEY}
|
|
- TAVILY_API_KEY=${TAVILY_API_KEY:-}
|
|
- NEWSAPI_API_KEY=${NEWSAPI_API_KEY:-}
|
|
- ENABLE_TRADING=${ENABLE_TRADING:-false}
|
|
- PYTHON_API_KEY=${PYTHON_API_KEY:-}
|
|
networks:
|
|
- immortal-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
volumes:
|
|
- ./agents/logs:/app/logs
|
|
|
|
# ============================================================================
|
|
# TypeScript Backend (API Gateway + DEX Trading)
|
|
# ============================================================================
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.backend
|
|
container_name: immortal-backend
|
|
ports:
|
|
- "3001:3001"
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-production}
|
|
- API_PORT=3001
|
|
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}
|
|
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
|
|
- GREENFIELD_BUCKET_NAME=${GREENFIELD_BUCKET_NAME}
|
|
- GREENFIELD_RPC_URL=${GREENFIELD_RPC_URL}
|
|
- GREENFIELD_CHAIN_ID=${GREENFIELD_CHAIN_ID}
|
|
- PYTHON_API_URL=http://python-api:5000
|
|
- PYTHON_API_KEY=${PYTHON_API_KEY:-}
|
|
- TRADING_NETWORK=${TRADING_NETWORK:-opbnb}
|
|
- NETWORK=${NETWORK:-testnet}
|
|
- POLYMARKET_ENABLED=${POLYMARKET_ENABLED:-true}
|
|
- ENABLE_CROSS_CHAIN=${ENABLE_CROSS_CHAIN:-true}
|
|
depends_on:
|
|
python-api:
|
|
condition: service_healthy
|
|
networks:
|
|
- immortal-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
|
|
# ============================================================================
|
|
# Frontend (Next.js Dashboard)
|
|
# ============================================================================
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: immortal-frontend
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NEXT_PUBLIC_API_URL=http://backend:3001
|
|
- NEXT_PUBLIC_WS_URL=http://backend:3001
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
networks:
|
|
- immortal-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
networks:
|
|
immortal-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
logs:
|
|
agent-logs:
|