mirror of
https://github.com/HKUDS/AI-Trader
synced 2026-04-21 13:37:41 +00:00
workers (#182) * Separate API service from background workers * Update frontend and environment defaults * Update frontend and environment defaults
58 lines
No EOL
1.9 KiB
Text
58 lines
No EOL
1.9 KiB
Text
# ==================== Environment ====================
|
|
ENVIRONMENT=development
|
|
|
|
# ==================== Database ====================
|
|
# PostgreSQL takes precedence when DATABASE_URL is set.
|
|
DATABASE_URL=postgresql://
|
|
ai_trader:xxxxxx@127.0.0.1:5432/ai_trader
|
|
|
|
# SQLite fallback path when DATABASE_URL is empty.
|
|
DB_PATH=service/server/data/clawtrader.db
|
|
|
|
# ==================== API Keys ====================
|
|
ALPHA_VANTAGE_API_KEY=demo
|
|
|
|
|
|
# ==================== Frontend ====================
|
|
# Frontend auto-refresh interval in milliseconds.
|
|
VITE_REFRESH_INTERVAL=300000
|
|
|
|
# ==================== Network / CORS ====================
|
|
CLAWTRADER_CORS_ORIGINS=http://localhost:3000,https://ai4trade.ai
|
|
|
|
# ==================== Market Data Endpoints
|
|
====================
|
|
ALPHA_VANTAGE_BASE_URL=https://www.alphavantage.co/query
|
|
HYPERLIQUID_API_URL=https://api.hyperliquid.xyz/info
|
|
POLYMARKET_GAMMA_BASE_URL=https://gamma-api.polymarket.com
|
|
POLYMARKET_CLOB_BASE_URL=https://clob.polymarket.com
|
|
|
|
# ==================== Background Tasks ====================
|
|
POSITION_REFRESH_INTERVAL=300
|
|
MAX_PARALLEL_PRICE_FETCH=5
|
|
POLYMARKET_SETTLE_INTERVAL=60
|
|
MARKET_NEWS_REFRESH_INTERVAL=900
|
|
MACRO_SIGNAL_REFRESH_INTERVAL=900
|
|
ETF_FLOW_REFRESH_INTERVAL=900
|
|
STOCK_ANALYSIS_REFRESH_INTERVAL=1800
|
|
|
|
# ==================== Profit History Retention
|
|
====================
|
|
# Keep recent history at full resolution.
|
|
PROFIT_HISTORY_FULL_RESOLUTION_HOURS=24
|
|
|
|
# Keep compacted history inside this rolling window.
|
|
PROFIT_HISTORY_COMPACT_WINDOW_DAYS=7
|
|
|
|
# Bucket size used when compacting older profit history.
|
|
PROFIT_HISTORY_COMPACT_BUCKET_MINUTES=15
|
|
|
|
# Minimum interval between prune/compact passes.
|
|
PROFIT_HISTORY_PRUNE_INTERVAL_SECONDS=3600
|
|
|
|
# ==================== Price Fetch Reliability ====================
|
|
PRICE_FETCH_TIMEOUT_SECONDS=10
|
|
PRICE_FETCH_MAX_RETRIES=2
|
|
PRICE_FETCH_BACKOFF_BASE_SECONDS=0.35
|
|
PRICE_FETCH_ERROR_COOLDOWN_SECONDS=20
|
|
PRICE_FETCH_RATE_LIMIT_COOLDOWN_SECONDS=60 |