Phase 5.2: TradingState-Split (Core-State vs. CopyTradingState)

- Core TradingState (in Core): globale Schalter, Accounts, MarketCache, GlobalPnl.
- Neuer CopyTradingState (im Modul): Traders, MasterTraderPositions,
  TraderAnalyticsCache, TotalCopyTrades/GetNextTradeId, PendingOrderTimestamps,
  SixSharesMinimum.
- 10 Konsumenten umgestellt (Program, frm_main, CopyTradingEngine,
  TraderMonitor, Alchemy, WSS, Snapshot, StartupHydration, beide Analytics-Jobs):
  Modul-Felder von _state.* auf _copyState.* umgeleitet, CopyTradingState via DI.
- Rein mechanische Feld-Umleitung, keine Logikänderung. Build 0 Fehler.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-07-01 20:09:50 +02:00
co-authored by Claude Opus 4.8
parent 55050a19e5
commit f8d395b2a3
13 changed files with 174 additions and 127 deletions
+4 -1
View File
@@ -20,6 +20,7 @@ namespace PolyTraderSharp.Services
private const string MarketWssUrl = "wss://ws-subscriptions-clob.polymarket.com/ws/market";
private readonly TradingState _state;
private readonly CopyTradingState _copyState;
private readonly ServerSettings _settings;
private readonly PolymarketClobClient _clob;
private readonly TerminalLogger _logger;
@@ -32,6 +33,7 @@ namespace PolyTraderSharp.Services
public PolymarketWssClient(
TradingState state,
CopyTradingState copyState,
ServerSettings settings,
PolymarketClobClient clob,
TerminalLogger logger,
@@ -40,6 +42,7 @@ namespace PolyTraderSharp.Services
IAccountRepository accountRepo)
{
_state = state;
_copyState = copyState;
_settings = settings;
_clob = clob;
_logger = logger;
@@ -266,7 +269,7 @@ namespace PolyTraderSharp.Services
var ct = new ClosedTrade
{
TradeId = _state.GetNextTradeId(),
TradeId = _copyState.GetNextTradeId(),
AccountId = acc.AccountId,
IsDemo = true,
MarketSlug = pos.MarketSlug,