Files
trading_bot_v3/docker-compose.yml
mindesbunister 52454bbf98 🚀 Fix position sizing and add real wallet balance integration
Fixed Position Size Calculation:
- Changed input from SOL to USD for clarity
- Fixed calculation: positionSizeSOL = positionValueUSD / coinPrice
- Resolved issue where entering 0.4 SOL showed incorrect 0.0025 underneath

 Added Real Wallet Balance Integration:
- TradeModal now fetches actual wallet balance from /api/wallet/balance
- Percentage buttons now calculate from real available balance (3.40)
- No more impossible 1 SOL positions when only 3.40 available

 Enhanced Position Sizing UI:
- Added slider for smooth position adjustment ( to full balance)
- Percentage buttons (25%, 50%, 75%, 100%) now accurate
- Real-time display shows both USD and SOL amounts
- Live percentage display of balance usage

 Added Wallet Overview to Dashboard:
- Main dashboard shows real wallet balance prominently
- Trading page displays actual wallet holdings
- StatusOverview component enhanced with wallet info

- Accurate position sizing based on actual 3.40 balance
- Intuitive slider + percentage buttons
- Real-time balance updates every 30 seconds
- Clear USD/SOL conversion display
- No more calculation errors in trading modal
2025-07-15 13:41:02 +02:00

58 lines
1.6 KiB
YAML

services:
app:
build:
context: .
dockerfile: Dockerfile
args:
JOBS: 8
NODE_OPTIONS: "--max-old-space-size=4096"
restart: unless-stopped
container_name: trader
# 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
# Port mapping - expose Next.js on port 9000
ports:
- "9000:3000"
# X11 and display configuration for manual CAPTCHA solving
# Use bridge network instead of host for better port management
networks:
- default
privileged: true
# Health check
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s