From 88c2bc84a13edb042e035d2db490b01fb5ba2b93 Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Thu, 16 Apr 2026 00:37:35 +0000 Subject: [PATCH] feat: upgrade paper trading to $100k moderate tier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Paper money has no downside — bigger capital exposes more model behavior: position sizing, diversification, sector exposure, correlation checks, circuit breakers, reserve pool siphoning, and risk tier auto-adjustment all become meaningful. - risk_tier: conservative → moderate (min_confidence 0.55) - absolute_position_cap: $25 → $10,000 - max_open_positions: 5 → 10 - initial portfolio value: $500 → $100,000 - Updated migration 019, Helm values, and engine default --- infra/helm/stonks-oracle/values.yaml | 6 +++--- infra/migrations/019_enable_paper_trading.sql | 8 ++++---- services/trading/engine.py | 6 ++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/infra/helm/stonks-oracle/values.yaml b/infra/helm/stonks-oracle/values.yaml index 1944e21..e1f6745 100644 --- a/infra/helm/stonks-oracle/values.yaml +++ b/infra/helm/stonks-oracle/values.yaml @@ -209,9 +209,9 @@ config: ALERT_BROKER_ERROR_WINDOW_HOURS: "1" ALERT_CHECK_INTERVAL_SECONDS: "120" TRADING_ENABLED: "true" - TRADING_RISK_TIER: "conservative" - TRADING_ABSOLUTE_POSITION_CAP: "25.0" - TRADING_MAX_OPEN_POSITIONS: "5" + TRADING_RISK_TIER: "moderate" + TRADING_ABSOLUTE_POSITION_CAP: "10000.0" + TRADING_MAX_OPEN_POSITIONS: "10" ## Secrets secrets: diff --git a/infra/migrations/019_enable_paper_trading.sql b/infra/migrations/019_enable_paper_trading.sql index 73626a4..02136a3 100644 --- a/infra/migrations/019_enable_paper_trading.sql +++ b/infra/migrations/019_enable_paper_trading.sql @@ -1,9 +1,9 @@ -- Migration 019: Enable paper trading configuration --- Sets conservative defaults for initial paper trading deployment. +-- Sets moderate defaults for paper trading with $100k capital. -- Requirements: 16.1, 5.1 UPDATE trading_engine_config SET enabled = true, - risk_tier = 'conservative', - absolute_position_cap = 25.0, - max_open_positions = 5; + risk_tier = 'moderate', + absolute_position_cap = 10000.0, + max_open_positions = 10; diff --git a/services/trading/engine.py b/services/trading/engine.py index 050f289..43c3ac4 100644 --- a/services/trading/engine.py +++ b/services/trading/engine.py @@ -552,10 +552,12 @@ class TradingEngine: logger.debug("Could not load circuit breaker state — using inactive") # Build portfolio state with defaults + # Default initial capital for paper trading — overridden by broker sync + initial_capital = 100000.0 self.portfolio_state = PortfolioState( reserve_pool=reserve_balance, - active_pool=max(0.0, 500.0 - reserve_balance), - total_value=500.0, + active_pool=max(0.0, initial_capital - reserve_balance), + total_value=initial_capital, ) async def _decision_loop(self) -> None: