✨ Features Added: - Real-time event subscription using Drift SDK EventSubscriber - Periodic fallback monitoring for position changes - Interactive UI controls for starting/stopping monitoring - Comprehensive data source status tracking - Multi-source trade aggregation and deduplication 🔧 Backend Implementation: - EventSubscriber integration with OrderActionRecord events - Fallback to periodic monitoring (30s intervals) if events fail - Real-time trade cache management (last 100 trades) - Enhanced data availability status with monitoring state - Improved trade history from 5+ different API sources 🎨 Frontend Enhancements: - Live monitoring toggle button (🔴 Start Live / 🟢 Live) - Real-time status panel showing active monitoring state - Trade counter and last activity timestamps - Clear cache functionality for real-time trades - Enhanced status modal with monitoring details 🔗 API Endpoints: - POST /api/drift/realtime-monitoring - Control monitoring - GET /api/drift/realtime-monitoring - Check status - GET /api/drift/data-status - Enhanced with monitoring state 🐳 Docker Integration: - Updated container configuration for persistent monitoring - Environment variable support for real-time features - Database persistence for captured trades 💾 Database & Storage: - Automatic storage of real-time detected trades - Deduplication logic to prevent synthetic/duplicate trades - Persistent cache across container restarts 🚀 Usage: - Click 'Start Live' button in Trading History panel - Monitor will attempt EventSubscriber, fallback to periodic checks - All future trades automatically captured and stored - Status panel shows monitoring state and trade statistics This implements comprehensive real-time trading monitoring for Drift Protocol with robust fallback mechanisms and professional UI integration.
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
network: host
|
|
|
|
# Base environment variables (common to all environments)
|
|
environment:
|
|
- DOCKER_ENV=true
|
|
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
- PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
- TRADINGVIEW_RECORD_VIDEO=true
|
|
- TZ=Europe/Berlin
|
|
# Playwright/TradingView automation settings
|
|
- CHROMIUM_PATH=/usr/bin/chromium
|
|
- DISABLE_CHROME_SANDBOX=true
|
|
- DISPLAY=${DISPLAY:-:0}
|
|
# CAPTCHA handling
|
|
- ALLOW_MANUAL_CAPTCHA=true
|
|
# Database configuration
|
|
- DATABASE_URL=file:./prisma/dev.db
|
|
|
|
# Load environment variables from .env file
|
|
env_file:
|
|
- .env
|
|
|
|
# Base volumes
|
|
volumes:
|
|
- ./screenshots:/app/screenshots
|
|
- ./videos:/app/videos
|
|
- ./.tradingview-session:/app/.tradingview-session
|
|
- ./prisma:/app/prisma
|
|
# X11 forwarding for GUI display (when ALLOW_MANUAL_CAPTCHA=true)
|
|
- /tmp/.X11-unix:/tmp/.X11-unix:rw
|
|
|
|
# X11 and display configuration for manual CAPTCHA solving
|
|
network_mode: host
|
|
privileged: true
|
|
|
|
# Health check
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:3000/ || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|