Skip to content

My Portfolio — Spec

Overview

Upload Mirae Asset (미래에셋) M-STOCK app screenshots to extract and track personal holdings. Uses a vision model to parse brokerage app screenshots into structured data.

Parsing

  • Screenshots sent to Gemini 2.5 Flash (vision) via the Google Generative AI SDK
  • Extracts: Korean holdings, US holdings, summary totals, cash positions
  • Returns structured JSON with summary, kr_holdings, and us_holdings keys
  • Korean stock names are mapped to KRX 6-digit codes via a static lookup table (portfolio/parser.py:KR_NAME_TO_TICKER)
  • Token usage tracked per parse: tokens_input, tokens_output, tokens_total stored on PortfolioSnapshot

Storage

  • Each upload creates a timestamped PortfolioSnapshot + PortfolioHolding rows
  • Safe to upload multiple times — each creates a new snapshot; history is preserved

Dashboard Tabs

Tab Content
Korean Stocks KR holdings from latest snapshot
US Stocks US holdings from latest snapshot
System Overlap Cross-references holdings against ML watchlist — shows 1d prediction + sentiment per position
History Total asset value over time (line chart); requires ≥2 snapshots

Constraints

  • Requires ANTHROPIC_API_KEY in .env; upload button disabled with error message if key absent
  • Supported image formats: JPEG, PNG, WebP
  • portfolio/parser.py:parse_screenshots() encodes images as base64 before sending