kristalApp

CLAUDE.md — Stock Options Academy

Project constitution. Claude Code reads this automatically every session. Follow it unless I explicitly override it in a message.

What this app is

A mobile app that teaches options and derivatives to students and undergraduates interested in finance. The MAIN GOAL is high-quality lessons that explain what options are and the basics of payoffs, risks, and benefits — followed by a Q&A the user answers after each lesson. Interactive option pricers support the lessons and (in advanced form) power a fake-money practice market. Engagement features (points, streaks, levels, leaderboard) keep learners coming back, Duolingo-style.

Core loop: Learn (card/reel lesson) → Answer (Q&A) → Earn (points/streak) → Level up → Unlock next lesson → Apply (interactive pricer / practice market).

Honest scope & STACK DECISION

Tech stack (don’t swap without asking)

Architecture principles

FINANCIAL DISCLAIMERS & RULES (non-negotiable — this is a finance app for young users)

  1. EDUCATIONAL ONLY. The app is not financial, investment, tax, or legal advice, and not a recommendation to buy or sell any security. Show clearly at onboarding; keep accessible in Settings.
  2. RISK IS TOLD HONESTLY. Every options lesson must explain downside honestly: long options can expire worthless (100% loss of premium), and some strategies (e.g. naked/short options) carry very large or theoretically unlimited losses. Never present options as easy money.
  3. NO PROFIT PROMISES. Do NOT use “how to make money”, “get rich”, “guaranteed returns”, or similar framing anywhere — marketing, lessons, or notifications. Reframe as “understand options” / “learn how options work”. Profit-promise language misleads learners, risks app-store rejection, and can create legal/regulatory exposure.
  4. SIMULATION != REAL. The fake-money practice market and any pricer output are simplified, idealized models. Label everywhere: “Simulation for learning. Models are idealized; real markets differ (liquidity, bid/ask spreads, dividends, early exercise, fees). Past or simulated performance does not indicate future results.”
  5. MODEL LIMITATIONS STATED. BSM assumes no arbitrage, constant volatility, European exercise, etc. Note key assumptions where a model is used; don’t imply models are exact.
  6. AUDIENCE MAY INCLUDE MINORS. Students/undergrads can be under 18. If we target or admit under-18 users: extra privacy obligations apply (parental considerations, COPPA/GDPR-K), and options-trading promotional content to minors is especially inappropriate — keep it strictly educational. Collect the minimum data needed. A privacy policy is required.
  7. HONEST LEADERBOARD. If bots pad the leaderboard, they must be clearly labeled as bots. Never present bot scores as real people.
  8. DATA HONESTY. If market data is delayed, label it delayed. Keep any paid data API key server-side (Edge Function), never in the shipped Flutter binary.
  9. NO DARK PATTERNS. Streaks and notifications encourage learning, not guilt or compulsion. Reasonable frequency, easy to turn off.

Content sources & accuracy

Monetization rules

Pricer requirements

Build progressively; each model is a tested function in the pure Dart pricer library.

Accessibility & UX

Build order (follow unless I say otherwise)

  1. App shell: Flutter + light/dark themes + Supabase init + auth (username/password + education level) + go_router navigation.
  2. Lesson engine + card/reel (vertical PageView) UI + first options lessons (calls, puts, payoffs, risk/benefit).
  3. Q&A engine after each lesson.
  4. Pricer core: BSM + Greeks (pure Dart library + tests) and payoff-diagram CustomPainter.
  5. Interactive pricer inside lessons (sliders update price/payoff live).
  6. Engagement: points, streaks, levels, certificate progression, local notifications.
  7. Leaderboard (real users + clearly labeled bots).
  8. Advanced pricer: Monte Carlo (basket, barrier KO/KI) on isolates, Heston, strategies, structured products.
  9. Fake-money real-time practice market (paid data API via Edge Function, delayed-data labels). Free — the paywall this phase once carried was removed on 6 August 2026.
  10. Personalized learning paths & notifications by education level. Then deploy (see DEPLOY.md).

Coding conventions