Skip to content

feat: tracker bridge signals, fees, events, and QA hardening#10

Open
claygeo wants to merge 2 commits intomainfrom
feat/tracker-bridge-signals
Open

feat: tracker bridge signals, fees, events, and QA hardening#10
claygeo wants to merge 2 commits intomainfrom
feat/tracker-bridge-signals

Conversation

@claygeo
Copy link
Copy Markdown
Owner

@claygeo claygeo commented Apr 13, 2026

Summary

  • Signal → Trade loop: "Take Trade" button on tracker signals with confirmation modal, source attribution (signal vs manual) persisted to positions table with SIG badge in UI
  • Realistic execution: Taker fees (0.05%) and linear slippage model (0.05% per $10k notional) wired into order execution and PnL calculation
  • Event sourcing foundation: Append-only events table with replay API (GET /api/replay), audit log for trade_executed, position_closed, signal_received
  • Bridge hardening: Zod validation on external tracker data, 24h staleness filter, typed ExternalServiceError with 502 responses, parallelized stats queries
  • Unified PriceService: Single source of truth (live WS → last known → null/reject), eliminates hardcoded fallback prices
  • WebSocket rate limiting: Per-connection 20 msg/s throttle with structured error frames
  • Security hardening: RLS tightened on events table, CHECK constraint on positions.source, service role INSERT only
  • 118 server tests across 9 suites covering all new code paths
  • 5 QA fixes: Responsive sidebar, username truncation, WS error logging, Supabase error handling, tracker bridge schema mismatch

Test plan

  • npm test — 118/118 pass
  • Typecheck clean (client + server)
  • Browser QA: signup → place order → verify fees/slippage → close position → check PnL
  • Mobile/tablet/desktop responsive testing
  • Signal "Take Trade" flow with confirmation modal
  • WS rate limit verified (>20 msg/s triggers disconnect)
  • Security review: RLS, input validation, service key exposure checked

claygeo added 2 commits April 13, 2026 13:08
1. Remove trader_count from tracker bridge query (column doesn't exist in external DB)
2. Fix WS error logging showing [object Event] instead of useful message
3. Fix mobile leaderboard username overflow into PnL column
4. Fix tablet (768px) Account Overview sidebar clipping
5. Downgrade profile/account creation errors to warnings (non-blocking, server creates on first trade)
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 13, 2026

Deploy Preview for trading-sim-hl ready!

Name Link
🔨 Latest commit af4c28b
🔍 Latest deploy log https://app.netlify.com/projects/trading-sim-hl/deploys/69dd247a40e05200085ceefd
😎 Deploy Preview https://deploy-preview-10--trading-sim-hl.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant