기술 블로그

← 모든 글

· InvestSim / invest-performance-sim (private)

Splitting the Paper Lab: Why InvestSim Lives in Its Own Repo

UI는 한국어입니다. 글 본문은 아직 영어 또는 중국어만 있습니다.

The product question

Invest AI answers “what does today look like?” — signals, dashboard context, and (eventually) richer decision surfaces. A different question sits next to it:

If we mechanically applied a small set of rules to a daily highlighted idea, with fixed starting capital and an auditable fill ledger, what does the equity curve look like?

That is research and education, not brokerage. It deserves its own deployable surface area: InvestSim (invest-performance-sim).

Why not nest inside Invest AI’s monorepo

Invest AI’s repo is already four runtimes (see Four Runtimes, One Repo). Adding a fifth package would:

  • Couple release cadence of a consumer dashboard to a simulation lab.
  • Invite accidental imports of Python-only paths or worker env assumptions.
  • Make “open source / private boundary” blur (sim may stay private longer).

Instead, InvestSim is a standalone Next.js + Prisma app that talks to Invest AI only over HTTPS (GET /api/v2/signals/top for v0 ingest).

Stack choices (boring on purpose)

LayerChoiceRationale
UINext.js App RouterOne deploy target; server components for dashboard reads.
DataPrisma + SQLite (local)Fast local loop; production is a deployment problem (Turso / Postgres), not a philosophy problem.
ChartRechartsGood enough for a credibility curve; no trading terminal fantasy.
Auth (v0)Single shared token + httpOnly cookieInternal dashboard; swap for OAuth when/if this goes wider.

Decision-first UI

We optimized for three seconds of comprehension:

  1. What does the AI pick say today? (symbol, confidence, action language)
  2. Am I winning on the simulated position? (P&L hero)
  3. Is the system credible over time? (equity + fills)

Specs live beside the code in docs/UI-MOCK-FIGMA-LEVEL.md and docs/UX-LAYOUT.md.

Honest limitations (v0)

  • Engine (auto open/close, rotates, stops) is not shipped yet — seed + manual ingest prove the spine.
  • SQLite on Vercel is not a durability story without libSQL / Postgres.
  • Not investment advice — same disclosure posture as Invest AI, duplicated in UI.

What we learned shipping the split early

  • Private repo + Vercel is a comfortable default for an internal lab; see Vercel Git Auto-Deploy….
  • Cron + bearer secret keeps ingest cheap and explicit; dashboard users never see cron keys.

Next engineering chapters

  1. Rules engine with versioned snapshots + idempotent day jobs.
  2. Hosted SQL + migration discipline.
  3. Contract tests for Invest AI JSON drift (fixtures in CI).