Investment 10-Year Viral Chart Video
Build high-retention, repeatable 9:16 vertical finance storytelling videos (e.g., "If you invested $1,000 in [TICKER] 10 years ago...") rendered deterministically to MP4 via HyperFrames.
Core Rules (Learned from Production)
- No Spoilers in the Hook: Never reveal the final dollar amount in the opening hook or sub-hook. Use curiosity hooks like
WHAT EVENTS CHANGED EVERYTHING?. - Real Monthly Data Only: Fetch exact monthly split-adjusted prices up to the current month using
scripts/fetch_monthly_prices.py(Yahoo Finance API). Never invent or smooth out real market crashes. - Research Latest Catalysts: Always search the web for the latest major price-moving events (including recent scandals, earnings, splits, or macro shocks) before finalizing the
eventsarray. - Zero-Flicker & Zero-Jitter Chart Rendering:
- Pre-mount all SVG milestone groups (
<g id="ms-0">...) and circular image pins (<g id="pin-0">...) in static HTML. Update onlytransformandopacityper frame—never rewriteinnerHTMLcontaining<image>elements. - Plot exact whole-month vertices (
0..floor(currIdx)) plus one interpolated tip(currIdx, currPrice). Never re-sample intermediate points withMath.ceil(currIdx * k)or shake the chart container, which causes line jitter.
- Pre-mount all SVG milestone groups (
- Visual Polish & Readability:
- TikTok 9:16 Safe Zone: Keep all main content inside
top: 185px,right: 150px(clear of right action buttons),bottom: 235px(clear of captions). - Full Event Thumbnails: Use
object-fit: contain; padding: 4px; background: #ffffff;on.event-thumbso products/hardware are never cropped. - Large Markers: Use
r="25"(50px) for circular milestone photo pins on the line andr="34"(68px) for the leading CEO/founder avatar dot. - All 4 Y-Axis Labels: Always render all 4 horizontal gridline price labels (
100%,67%,33%,$0). - Subtle Motion Background: Drift the background grid slowly and float faint grayscale company logos (
opacity: 0.055) via GSAP timeline. - No Middle Dots: Never use
•anywhere in copy; use|or—. - No Footer Clutter: Do not place small disclaimer/safe-zone notes at the bottom of the frame.
- TikTok 9:16 Safe Zone: Keep all main content inside
Modes
- Mode 1 — Single Asset (
templates/compositions/race.html): Deep-dive into one stock/coin (NVDA,AAPL,BTC-USD) with a CEO intro, dynamic Y-axis, milestone photo pins, and Market Cap tracking. - Mode 2 — 2-Company Versus (
templates/compositions/versus.html): Head-to-head race between two assets (e.g.,FPT.VNvsVNM.VN,AAPLvsMSFT,BTC-USDvsNVDA). Both start at the same initial capital (e.g.,100M VNDfor.VNtickers,$1,000for US/Crypto) and race on a shared dynamic Y-axis with lead-change card highlighting. - Mode 3 — Top 10 Bar Chart Race (
templates/compositions/race10.html): Fast-paced 20s Bar Chart Race comparing 15 contenders (Top 10 visible) with real company logos, Market Cap, smooth Gaussian-interpolated Y-axis rank swaps (getSmoothedRank+getSmoothedMult), warm 115 BPM audio (--duration 20, no high-pitched arps/ticks), and an End Winner Spotlight (17.1s → 20.0s) that blurs the race board (blur(8px)) and pops up a centered Champion modal dynamically populated from the actual#1–#3finishers.
Workflow
- Fetch Real Monthly Prices:
- Single asset:
python scripts/fetch_monthly_prices.py --ticker NVDA --start 2016-01-01 --out monthly.json - Multi-company comparison / Top 10 Bar Chart Race (including Vietnam stocks with
.VNsuffix):python scripts/fetch_monthly_prices.py --tickers XOM,CVX,COP,EOG,SLB,OXY,MPC,VLO,PSX,HAL,DVN,BKR,FANG,KMI,WMB --start 2016-01-01 --out race15_monthly.json
- Single asset:
- Research Events & Download Real Assets:
- Search for 6–7 key historical catalysts (including the latest current-month news) and download authentic images (CEO portrait, hardware/product photos, crisis/crash visuals, company SVG logo) into
assets/.
- Search for 6–7 key historical catalysts (including the latest current-month news) and download authentic images (CEO portrait, hardware/product photos, crisis/crash visuals, company SVG logo) into
- Generate Clean Audio (BGM + SFX):
python scripts/generate_audio.py --duration 30 --out-dir assets/ - Scaffold & Customize HyperFrames Project:
- Start from
templates/index.htmlandtemplates/race.html. - Embed the monthly
[YYYY-MM, price]array andeventslist. - Align
<audio>data-starttimestamps forsfx_pop.mp3andsfx_crash.mp3with each milestone's exact arrival time (t = start + (ev.idx / TOTAL_MONTHS) * duration).
- Start from
- Verify & Render MP4:
npx hyperframes check --json npx hyperframes snapshot --at 0.5,12.0,28.5 --json npx hyperframes render --output out.mp4 --json