What I Built
TickerTales turns a trading day on India's NIFTY 50 into a live T20 cricket broadcast.
Points gained over the previous close are runs. A sharp 15-minute rally is a FOUR — a violent one is a SIX, clobbered into the stands. A sudden drop? WICKET! The top-gaining stocks are the batsmen who carried the innings; the biggest losers are the bowlers who did the damage. At the close, the verdict flashes up like a match result: BULLS WIN or BEARS WIN.
Google Gemini watches the day's match card and writes the commentary. ElevenLabs voices it like a stadium broadcaster. You get a scorecard UI straight out of a TV graphics package, plus a 90-second audio "match report" of the trading day.
Why (The Passion Part)
I run a software company in India, which means I carry two national obsessions at once: cricket and the stock market. I've spent years building stock automation pipelines for fun — and like every Indian, I grew up with radio commentary as the soundtrack of summer.
One day it hit me: the way I follow the market is the way I follow a match. "Nifty is defending 24,000 like a night-watchman." "Reliance is playing a captain's knock today." I was already narrating the market in cricket in my head. This challenge was the excuse to make the voice in my head real — literally.
Demo
Repo: https://github.com/rahuljoshi0808/tickertales
Video walkthrough:
The scorecard for Friday's session: NIFTY 50 finished 24,206.9 — that's 244.1 runs at nearly run-a-ball, BULLS WIN, with Reliance top-scoring at +2.19%.
How I Built It
The pipeline is deliberately simple — one weekend, one Node.js app, zero heavy dependencies:
Yahoo Finance (intraday candles)
→ market.js translates the day into a "match card"
→ Gemini 3.5 Flash writes broadcast commentary (structured JSON output)
→ ElevenLabs TTS voices it with an animated commentator delivery
→ a TV-graphics scorecard UI with an audio player
The cricket translation layer is the heart of it. I compute the average absolute move across the day's 15-minute candles, then classify each candle relative to that: >2.5× average up = SIX, >1.3× = FOUR, mirrored on the downside for WICKETs and dot-ball pressure. This means the drama auto-calibrates — a boring day produces a tense low-scoring affair, a volatile day reads like a T20 slugfest.
Google AI (Gemini 3.5 Flash) gets the full match card as JSON and a system prompt that casts it as a commentator ("Harsha Bhogle energy"). I use responseMimeType: "application/json" to force structured output — headline, a 250-word narration written to be read aloud, five ball-by-ball one-liners, and a Player of the Day. Writing prose for the ear, not the eye, was the key prompt-engineering lesson: numbers as words, flowing sentences, no lists.
ElevenLabs renders the narration with eleven_multilingual_v2, with stability turned down to 0.35 and style up to 0.6 — that's what shifts the delivery from audiobook-calm to commentary-box excitement.
What I Learned
Metaphor is a data-visualization tool. People who glaze over at "+1.02%" instantly understand "244 runs, bulls win." The cricket frame isn't a gimmick — it's compression.
Structured output changed how I use LLMs. Letting Gemini return validated JSON means the commentary drops straight into the UI and the TTS pipe with zero parsing glue.
Voice settings matter as much as the script. The same narration at default ElevenLabs settings sounds like a newsreader; tuned, it sounds like the death overs.
Not investment advice — it's a match report. 🏏
Top comments (0)