Changelog
What's New
Track every feature, improvement, and fix shipped to AlsaTrade.
v2.9 February 28, 2026
Architecture Improvements & Test Coverage
Improvement
- Migrated ~98 frontend files from console.log to shared logger utility
- Centralized environment config with pydantic-settings
- Split pine_monitor.py (1,847 lines) and pine_transpiler.py into modular packages
- Split TradingViewPage and PortfolioAnalyticsPage into sub-packages
- Extracted shared hooks (useSymbolFilter, formatters) replacing 7 inline copies
- Reduced `as any` casts from 56 to 25 across the frontend
- Extracted middleware and background tasks from main.py (686 → 168 lines)
New Feature
- WebSocket shared utilities: SubscriptionMap, getBackoffDelay, wsSendJson
- Pydantic models for 3 previously raw JSON endpoints
v2.8 February 23, 2026
Comprehensive Security Audit & Exchange Selection
Security
- Credential hardening: decrypt_if_needed() rejects plaintext for all exchanges
- Circuit breaker pattern for Binance, Bybit, and Alpaca API calls
- Global exception handler for unhandled errors
Bug Fix
- 12 backend bug fixes including admin endpoint fields, optimizer variable, and balance fallback
- Frontend NaN guards, React key warnings, and balance endpoint corrections
- Strategy dialog exchange force-sync removed — now defaults correctly on open
- Pine trigger panel: script selector dropdown added with exchange-aware defaults
Improvement
- Bundle splitting: main chunk reduced from 505 kB to 289 kB
- Exchange-aware TradingView chart symbol prefixes (BINANCE:, BYBIT:, bare for stocks)
- Dead code removal: 9 console.log blocks, unused buttons wired up
v2.7 February 17, 2026
Security Hardening & Trading Precision
Security
- UserSession table: JTI tracking, session creation on login/OTP/refresh, revocation on logout
- Per-exchange encryption keys with shared fallback (BINANCE_, BYBIT_, ALPACA_ENCRYPTION_KEY)
- Tokens removed from sessionStorage — only isLoggedIn flag remains
- Balance race condition fixed with pg_advisory_xact_lock
Bug Fix
- Iceberg/advanced order float precision: safe_decimal() for all quantity splits
- Bybit trailing stop callback rate clamped to minimum 1%
- Position side detection in BOTH mode: multi-branch heuristic for TP/SL
- Backend WebSocket broadcast: 5s timeout per connection with stale cleanup
v2.6 February 14, 2026
Alpaca Enhancements & Pre-Flight Validation
New Feature
- Pre-flight order validation: fractional share rounding, short sell checks, buying power for BUY + SELL
- PDT status endpoint returns daytrading_buying_power
- Options chain overhaul with Greeks display
Bug Fix
- Fractional orders blocked for non-fractionable stocks
- Short sell validation checks shortable attribute
- Market-hours order queue processor for stocks
v2.5 February 12, 2026
Financial Precision & Token Security
Bug Fix
- Float → Decimal migration: 7 files migrated to safe_decimal() for financial calculations
- Refresh token cookie path mismatch fixed
- Token type validation added to prevent access/refresh token misuse
- OTP counter race condition resolved
Improvement
- safe_decimal() and safe_float() utilities for consistent financial precision
- Structured logging: 200+ print statements replaced across 5 trading API files
v2.4 February 9, 2026
Infrastructure & Configuration Fixes
Bug Fix
- Dev environment no longer points to production
- CORS URL mismatch resolved
- Blocking time.sleep() replaced with async-safe alternatives in async handlers
v2.3 January 2026
Performance Optimization
Improvement
- Code splitting with vendor-charts, vendor-radix, and vendor-devtools chunks
- React Query migration for server state management
- React.memo optimization for frequently re-rendered components
- Vite build optimizations for faster dev and production builds
- VirtualTable component for rendering long lists efficiently
- Webhook rate limiting to prevent abuse