[18:18:28] ============================================================
[18:18:28] CV6 PAPER TRADING SESSION — ACTUAL RUNTIME DATA
[18:18:28] Session Date: 2026-06-30
[18:18:28] ============================================================
[18:18:28] [STEP 1] GET /  → 200: {'success': True, 'message': 'CV6 AI Trading OS Running Successfully'}
[18:18:28] 
[18:18:28] [STEP 2] Registering user...
[18:18:29] POST /users/register → 200: {"success":true,"user_id":3}
[18:18:29] 
[18:18:29] [STEP 3] Logging in...
[18:18:30] POST /users/login → 200: {"success":true,"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJwc2FzaTE0NEBnbWFpbC5jb20iLCJ1c2VyX2lkIjozLCJleHAiOjE3ODI4MjczMTB9.6QhTb-AHdciKscJYa-5mC5pDHr_urZ2nKCQ7b2-ZuOI","token_type":"bearer"}
[18:18:30] JWT token obtained: YES — eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
[18:18:30] 
[18:18:30] [STEP 4] Testing protected endpoint without token...
[18:18:30] GET /paper/account (no auth) → 403 (expected 403)
[18:18:30] GET /paper/account (with JWT) → 200: {"total_capital":100000.0,"available_capital":100000.0,"invested_amount":0,"realized_pnl":0,"unrealized_pnl":0,"total_pnl":0,"open_positions":[],"trade_count":0,"win_count":0,"loss_count":0,"win_rate"
[18:18:30] 
[18:18:30] [STEP 5] Executing paper trades...
[18:18:30]   Trade 01: ✅ BUY   1x NIFTY      @ 24350.00  → Paper BUY executed: 1 NIFTY @ ₹24350.0
[18:18:30]   Trade 02: ✅ BUY   1x BANKNIFTY  @ 52100.00  → Paper BUY executed: 1 BANKNIFTY @ ₹52100.0
[18:18:31]   Trade 03: ❌ BUY  10x RELIANCE   @  2940.00  → Insufficient capital (need ₹29,400, have ₹23,550)
[18:18:31]   Trade 04: ✅ BUY   5x TCS        @  3820.00  → Paper BUY executed: 5 TCS @ ₹3820.0
[18:18:31]   Trade 05: ❌ BUY  10x INFY       @  1540.00  → Insufficient capital (need ₹15,400, have ₹4,450)
[18:18:32]   Trade 06: ❌ BUY  10x HDFCBANK   @  1680.00  → Insufficient capital (need ₹16,800, have ₹4,450)
[18:18:32]   Trade 07: ❌ BUY  20x ICICIBANK  @   960.00  → Insufficient capital (need ₹19,200, have ₹4,450)
[18:18:32]   Trade 08: ❌ BUY  20x SBIN       @   820.00  → Insufficient capital (need ₹16,400, have ₹4,450)
[18:18:33]   Trade 09: ✅ SELL  1x NIFTY      @ 24420.00  → Paper SELL executed: 1 NIFTY @ ₹24420.0
[18:18:33]   Trade 10: ❌ SELL 10x RELIANCE   @  2975.00  → No open BUY position for RELIANCE. Cannot SELL.
[18:18:33]   Trade 11: ✅ SELL  5x TCS        @  3860.00  → Paper SELL executed: 5 TCS @ ₹3860.0
[18:18:33]   Trade 12: ❌ SELL 10x INFY       @  1555.00  → No open BUY position for INFY. Cannot SELL.
[18:18:34]   Trade 13: ❌ SELL 10x HDFCBANK   @  1695.00  → No open BUY position for HDFCBANK. Cannot SELL.
[18:18:34]   Trade 14: ❌ SELL 20x ICICIBANK  @   975.00  → No open BUY position for ICICIBANK. Cannot SELL.
[18:18:34]   Trade 15: ❌ SELL 20x SBIN       @   835.00  → No open BUY position for SBIN. Cannot SELL.
[18:18:35]   Trade 16: ✅ BUY   1x NIFTY      @ 24380.00  → Paper BUY executed: 1 NIFTY @ ₹24380.0
[18:18:35]   Trade 17: ❌ BUY   1x BANKNIFTY  @ 52250.00  → Insufficient capital (need ₹52,250, have ₹23,790)
[18:18:35]   Trade 18: ✅ BUY   5x RELIANCE   @  2960.00  → Paper BUY executed: 5 RELIANCE @ ₹2960.0
[18:18:36]   Trade 19: ❌ BUY   3x TCS        @  3840.00  → Insufficient capital (need ₹11,520, have ₹8,990)
[18:18:36]   Trade 20: ✅ BUY   5x INFY       @  1548.00  → Paper BUY executed: 5 INFY @ ₹1548.0
[18:18:36]   Trade 21: ✅ SELL  1x NIFTY      @ 24450.00  → Paper SELL executed: 1 NIFTY @ ₹24450.0
[18:18:37]   Trade 22: ✅ SELL  1x BANKNIFTY  @ 52400.00  → Paper SELL executed: 1 BANKNIFTY @ ₹52400.0
[18:18:37]   Trade 23: ✅ SELL  5x RELIANCE   @  2990.00  → Paper SELL executed: 5 RELIANCE @ ₹2990.0
[18:18:37]   Trade 24: ❌ SELL  3x TCS        @  3870.00  → No open BUY position for TCS. Cannot SELL.
[18:18:38]   Trade 25: ✅ SELL  5x INFY       @  1560.00  → Paper SELL executed: 5 INFY @ ₹1560.0
[18:18:38]   Trade 26: ✅ BUY   2x NIFTY      @ 24320.00  → Paper BUY executed: 2 NIFTY @ ₹24320.0
[18:18:38]   Trade 27: ✅ BUY   1x BANKNIFTY  @ 52050.00  → Paper BUY executed: 1 BANKNIFTY @ ₹52050.0
[18:18:38]   Trade 28: ❌ BUY   5x HDFCBANK   @  1670.00  → Insufficient capital (need ₹8,350, have ₹160)
[18:18:39]   Trade 29: ❌ BUY  10x ICICIBANK  @   950.00  → Insufficient capital (need ₹9,500, have ₹160)
[18:18:39]   Trade 30: ❌ BUY  10x SBIN       @   815.00  → Insufficient capital (need ₹8,150, have ₹160)
[18:18:39]   Trade 31: ✅ SELL  2x NIFTY      @ 24390.00  → Paper SELL executed: 2 NIFTY @ ₹24390.0
[18:18:40]   Trade 32: ✅ SELL  1x BANKNIFTY  @ 52200.00  → Paper SELL executed: 1 BANKNIFTY @ ₹52200.0
[18:18:40]   Trade 33: ❌ SELL  5x HDFCBANK   @  1688.00  → No open BUY position for HDFCBANK. Cannot SELL.
[18:18:40]   Trade 34: ❌ SELL 10x ICICIBANK  @   965.00  → No open BUY position for ICICIBANK. Cannot SELL.
[18:18:41]   Trade 35: ❌ SELL 10x SBIN       @   828.00  → No open BUY position for SBIN. Cannot SELL.
[18:18:41] 
Trades executed: 16 success, 19 failed out of 35 total
[18:18:41] 
[18:18:41] [STEP 6] Account snapshot...
[18:18:41] GET /paper/account → 200
[18:18:41]   capital:         ₹100,000.00
[18:18:41]   total_capital: 100000.0
[18:18:41]   available_capital: 101140.0
[18:18:41]   invested_amount: 0
[18:18:41]   realized_pnl: 1140.0
[18:18:41]   unrealized_pnl: 0
[18:18:41]   total_pnl: 1140.0
[18:18:41]   open_positions: []
[18:18:41]   trade_count: 8
[18:18:41]   win_count: 8
[18:18:41]   loss_count: 0
[18:18:41]   win_rate: 100.0
[18:18:41] 
[18:18:41] [STEP 7] Trade history...
[18:18:41] GET /paper/history → 200
[18:18:41]   Response: {'trades': [{'symbol': 'BANKNIFTY', 'side': 'BUY→SELL', 'qty': 1, 'entry': 52050.0, 'exit': 52200.0, 'pnl': 150.0, 'time': '2026-06-30 18:18:40'}, {'symbol': 'NIFTY', 'side': 'BUY→SELL', 'qty': 2, 'entry': 24320.0, 'exit': 24390.0, 'pnl': 140.0, 'time': '2026-06-30 18:18:39'}, {'symbol': 'INFY', 'si
[18:18:41] 
[18:18:41] [STEP 8] Dashboard endpoint...
[18:18:41] GET /dashboard/ → 200: {"success":true,"generated_at":1782823721.503144,"portfolio":[],"funds":{"available_cash":0.0,"used_margin":0.0,"total_funds":0.0,"collateral":0.0,"broker":""},"pnl":{"realized_pnl":0.0,"unrealized_pnl":0.0,"total_pnl":0.0,"total_charges":0.0,"net_pnl":0.0,"winning_trades":0,"losing_trades":0,"win_r
[18:18:41] 
[18:18:41] [STEP 9] Rate limit test (6 rapid login attempts from same IP)...
[18:18:41]   Attempt 1: 401 — Invalid password
[18:18:42]   Attempt 2: 401 — Invalid password
[18:18:42]   Attempt 3: 401 — Invalid password
[18:18:43]   Attempt 4: 401 — Invalid password
[18:18:43]   Attempt 5: 429 — Too many login attempts. Try again in 60s.
[18:18:43]   ✅ Rate limit triggered correctly at attempt 5
[18:18:43] 
[18:18:43] [STEP 10] SELL-on-no-position guard test...
[18:18:43]   ✅ Guard works: No open BUY position for WIPRO. Cannot SELL.
[18:18:43] 
[18:18:43] [STEP 11] WebSocket /ws/ticks — Note: requires ws:// client, verified via code audit
[18:18:43] 
[18:18:43] ============================================================
[18:18:43] SESSION SUMMARY — ACTUAL RUNTIME DATA
[18:18:43] ============================================================
[18:18:43] Backend URL:    http://127.0.0.1:8000
[18:18:43] Backend status: RUNNING (Swagger confirmed)
[18:18:43] Registration:   TESTED
[18:18:43] Login/JWT:      TESTED
[18:18:43] Paper trades:   16 PASS / 19 FAIL (35 total)
[18:18:43] Auth guard:     TESTED (403 without token)
[18:18:43] Rate limit:     TESTED
[18:18:43] SELL guard:     TESTED
[18:18:43] Report saved to: D:\CV6_AI_Trading_OS\PAPER_SESSION_RESULTS.txt
[18:18:43] ============================================================