feat: Add direction-specific quality thresholds and dynamic collateral display
- Split QUALITY_LEVERAGE_THRESHOLD into separate LONG and SHORT variants - Added /api/drift/account-health endpoint for real-time collateral data - Updated settings UI to show separate controls for LONG/SHORT thresholds - Position size calculations now use dynamic collateral from Drift account - Updated .env and docker-compose.yml with new environment variables - LONG threshold: 95, SHORT threshold: 90 (configurable independently) Files changed: - app/api/drift/account-health/route.ts (NEW) - Account health API endpoint - app/settings/page.tsx - Added collateral state, separate threshold inputs - app/api/settings/route.ts - GET/POST handlers for LONG/SHORT thresholds - .env - Added QUALITY_LEVERAGE_THRESHOLD_LONG/SHORT variables - docker-compose.yml - Added new env vars with fallback defaults Impact: - Users can now configure quality thresholds independently for LONG vs SHORT signals - Position size display dynamically updates based on actual Drift account collateral - More flexible risk management with direction-specific leverage tiers
This commit is contained in:
@@ -49,7 +49,9 @@ services:
|
||||
USE_ADAPTIVE_LEVERAGE: ${USE_ADAPTIVE_LEVERAGE:-true}
|
||||
HIGH_QUALITY_LEVERAGE: ${HIGH_QUALITY_LEVERAGE:-5}
|
||||
LOW_QUALITY_LEVERAGE: ${LOW_QUALITY_LEVERAGE:-1}
|
||||
QUALITY_LEVERAGE_THRESHOLD: ${QUALITY_LEVERAGE_THRESHOLD:-95}
|
||||
QUALITY_LEVERAGE_THRESHOLD_LONG: ${QUALITY_LEVERAGE_THRESHOLD_LONG:-95}
|
||||
QUALITY_LEVERAGE_THRESHOLD_SHORT: ${QUALITY_LEVERAGE_THRESHOLD_SHORT:-90}
|
||||
QUALITY_LEVERAGE_THRESHOLD: ${QUALITY_LEVERAGE_THRESHOLD:-95} # Backward compatibility
|
||||
|
||||
# Database (if using PostgreSQL)
|
||||
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/trading_bot_v4}
|
||||
|
||||
Reference in New Issue
Block a user