# racinglines > racinglines turns official race timing into win, podium, head-to-head and championship odds for race-sport prediction markets (Formula 1 on Polymarket and Kalshi, UCI downhill mountain biking, NASCAR Cup and MotoGP), priced strictly as of any moment and tested on real market tapes. These docs cover the data pipelines, the pricing models and their evaluation, market making and paper trading, the sportsbook slip schema, the web app and MCP server, the CLI (with a synthetic kart demo pack that runs offline), and how the production VM is run. The full text of every page below, in this order, is at https://racinglines.bet/llms-full.txt. Each link is the page's Markdown source on GitHub; the rendered site is https://racinglines.bet/docs/. ## Get started - [Overview](https://github.com/racinglines/racinglines/blob/main/docs/index.md): Tools for an edge in race-sport prediction markets. racinglines turns official timing into win, podium, head-to-head and championship odds, priced strictly as of any moment and tested on real market tapes, and gives … - [Quickstart](https://github.com/racinglines/racinglines/blob/main/docs/quickstart.md): Every command below is a normal `racinglines` command with `--demo` added. `--demo` switches the data source to a demo store (a separate database and data folder filled from a data pack) and changes nothing else. - [Demo data packs](https://github.com/racinglines/racinglines/blob/main/docs/demo.md): The commands to run are in the Quickstart. This page is how a demo store works, what the bundled `kart` pack holds, how the hosted demo store serves it, and how to add a pack of your own. - [Contributing](https://github.com/racinglines/racinglines/blob/main/docs/contributing.md): Thanks for wanting to help! racinglines is in beta, and we're looking for beta testers and collaborators. This page is a starting point: more detail is coming. Questions, ideas or "I'd like to help with X": ## Use the app - [Web app](https://github.com/racinglines/racinglines/blob/main/docs/webapp.md): `racinglines/web/` is the maker/taker web app (FastAPI, server-rendered pages, no JavaScript framework) on top of the database. - [Alpha layout](https://github.com/racinglines/racinglines/blob/main/docs/alpha-layout.md): The web app's layout for the fantasy alpha (owner, 2026-10-12): four tabs and nothing else. It is a switch, not a rewrite. - [Fantasy league: Fantasy soft launch (index)](https://github.com/racinglines/racinglines/blob/main/docs/fantasy-launch.md): This is the plan as written on 29 and 30 Sep. What shipped is the fantasy league alpha on production (2026-10-12): - [Fantasy league: Fantasy accounts](https://github.com/racinglines/racinglines/blob/main/docs/fantasy-accounts.md): Today only an admin can create a racinglines account. There is one admin, two demo logins and one system account. A session is a stateless 12-hour cookie, and one CSRF token serves the whole process. - [Fantasy league: Fantasy trading](https://github.com/racinglines/racinglines/blob/main/docs/fantasy-trading.md): Status: draft for the owner, Tue 2026-09-29. Every feature is behind a switch that is off by default. A first cut of exchange paper trading for takers is built (2026-10-12, staging only): see First cut. ## CLI - [CLI reference](https://github.com/racinglines/racinglines/blob/main/docs/cli.md): Everything runs through one command (after `pip install "racinglines[db]"`, or `pip install -e ".[web]"` in a clone). The task comes first and the sport is an argument. `racinglines -h` is the map: - [Terminal app (racinglines tui)](https://github.com/racinglines/racinglines/blob/main/docs/tui.md): `racinglines tui` is the web app's tabs in a terminal, built with Textual and Rich. It holds one MCP session and calls the same tools a chat client does (MCP server): - [Sportsbook schema (draft): Schema, CLI and MCP surface](https://github.com/racinglines/racinglines/blob/main/docs/sportsbook/index.md): Owner decisions (2026-10-06): sportsbook analysis stays separate from the web app, CLI tools only; events are defined by exchange-agnostic schemas; - [Sportsbook schema (draft): Slip EV (book map, price, settle)](https://github.com/racinglines/racinglines/blob/main/docs/sportsbook/slips.md): `racinglines book map | price | settle` takes a generic sportsbook's lines and slips, written as a book file (schema), and puts three prices beside each bet: - [Sportsbook schema (draft): Bet-slip graphics (book render)](https://github.com/racinglines/racinglines/blob/main/docs/sportsbook/render.md): `racinglines book render` turns a priced board into one self-contained HTML page, and a PNG when a headless Chromium is around, in three styles. It reads the same prices as `book price`: - [Sportsbook schema (draft): Market vocabulary](https://github.com/racinglines/racinglines/blob/main/docs/sportsbook/vocabulary.md): Generated from `schemas/kinds-vocabulary.toml`. Status: exists = in `racinglines/markets/kinds.py`; props = in `props.py`, not in the registry; proposed = a new code in the same style; no_data = no data source known. ## MCP - [MCP server](https://github.com/racinglines/racinglines/blob/main/docs/mcp.md): `racinglines mcp` starts a Model Context Protocol server in the app's own Python environment, against the same database and Parquet archive the web app and the CLI use. ## Sports & data - [Sports and exchanges (status)](https://github.com/racinglines/racinglines/blob/main/docs/coverage.md): Where every sport stands on every exchange: what data we hold, what prices it, what has been backtested and how far the result can be trusted, and what runs live or on paper. - [Adding a sport](https://github.com/racinglines/racinglines/blob/main/docs/add-a-sport.md): What adding NASCAR Cup and MotoGP (results-backed, modeled) and IndyCar, road cycling, Le Mans and SailGP (tape only) actually took, in the order it has to happen. Each step links to the section that holds the detail; - [Sources & layout](https://github.com/racinglines/racinglines/blob/main/docs/data.md): Every path comes from `racinglines/paths.py`. Set `RACINGLINES_DATA` to move the whole tree. - [Parser](https://github.com/racinglines/racinglines/blob/main/docs/parser.md): `racinglines/sources/chronorace/parse.py` turns raw result files into one tidy long-format CSV. The predictor reads only this CSV, so any new data source only needs a parser path. - [Database](https://github.com/racinglines/racinglines/blob/main/docs/database.md): Results, athletes, model runs and predictions live in PostgreSQL. The Python side is `racinglines/db/`: SQLAlchemy 2 models, Alembic migrations, ingest, and query helpers. - [Data changes: Data change log](https://github.com/racinglines/racinglines/blob/main/docs/data-changes.md): A record of the changes to the race history the models read: what changed, when, why, and how to undo it. - [Data changes: Kalshi bid/ask re-pull (2026-10-05)](https://github.com/racinglines/racinglines/blob/main/docs/data-changes/2026-10-05-kalshi-bid-ask-repull.md): Kalshi taker replays read `market_price_history.price`, the hourly candle's last-trade close (or the bid/ask mid when nothing traded). A last trade can be far from where a taker could have filled. - [Weather forecasts](https://github.com/racinglines/racinglines/blob/main/docs/weather.md): Weather forecasts as one frame a model can read, whoever made the forecast (`racinglines/weather/`). Open-Meteo is the default provider: - [Exchanges as schemas (OG.com)](https://github.com/racinglines/racinglines/blob/main/docs/exchanges.md): A venue with a plain JSON market-data API is a file, not code: `exchanges/.toml`, read by one generic driver (`racinglines/markets/exchange_driver.py`) the same way `sports/.toml` describes a sport. - [Kalshi history](https://github.com/racinglines/racinglines/blob/main/docs/kalshi-history.md): The maker's record on Kalshi, filled only by Kalshi's real taker trades. Everything here is off by default: nothing changes until the Kalshi tape is synced and one of the commands below is run. - [FIS alpine skiing](https://github.com/racinglines/racinglines/blob/main/docs/alpine.md): The newest sport (2026-10-22): FIS Alpine World Cup, World Championships and Olympic races since the 2018/19 season, priced per gender and discipline by the one engine. ## Models - [Formula 1: F1 model](https://github.com/racinglines/racinglines/blob/main/docs/f1.md): F1 is the second sport, and the first one with liquid markets. It uses the same database, web app and private book as downhill, and the one engine (`racinglines/models/model_global.py`) with F1's lap-level inputs … - [Formula 1: F1 evaluation](https://github.com/racinglines/racinglines/blob/main/docs/f1-evaluation.md): How accurate the F1 model is: an as-of backtest over every race since 2021, per-season tables, the model variants, and a comparison with Polymarket's prices. The live forecast is on F1 forecast. - [Formula 1: F1 forecast](https://github.com/racinglines/racinglines/blob/main/docs/f1-forecast.md): Current forecast: 2026 season, rounds 18–23. Updated 2026-10-14 from the run production serves. - [Formula 1: F1 calibration](https://github.com/racinglines/racinglines/blob/main/docs/f1-calibration.md): The F1 sector simulation is too flat: it gives favourites too little and long shots too much. Over 2025, drivers it priced at 5 to 10% to win won 2.0% of the time, and drivers it priced at 10 to 35% won more often than … - [Formula 1: Market making](https://github.com/racinglines/racinglines/blob/main/docs/market-making.md): How we test whether trading a market is worth it before risking money: on one event in depth, then on a whole season. - [Formula 1: Paper trading](https://github.com/racinglines/racinglines/blob/main/docs/paper-trading.md): How a strategy found in the backtests is run live, on paper: each user gets a strategy profile, a signal engine replays that profile on the current race weekend every 5 minutes, and the results show on the Strategy and … - [Formula 1: Championship markets](https://github.com/racinglines/racinglines/blob/main/docs/championship-markets.md): Season-long markets for the soft-launch sports (F1, NASCAR Cup, MotoGP) on Polymarket, Kalshi and OG.com, what the syncs call them, and which of them a model prices. - [Downhill: Downhill model](https://github.com/racinglines/racinglines/blob/main/docs/model.md): The downhill season model lives in `racinglines/models/inputs/run_times/` (section 7) and is driven by `racinglines model forecast mtb_dh` and `racinglines model backtest mtb_dh`. It answers: - [Downhill: Downhill evaluation](https://github.com/racinglines/racinglines/blob/main/docs/evaluation.md): How accurate the downhill model is: a walk-forward backtest over every UCI World Cup round with timing data, per season and per event. The live projection is on Downhill forecast. For Formula 1, see F1 evaluation. - [Downhill: Downhill forecast](https://github.com/racinglines/racinglines/blob/main/docs/forecast.md): Current forecast: 2026 Men Elite. - [Engine: Backtest core (all sports)](https://github.com/racinglines/racinglines/blob/main/docs/backtest-core.md): The plan for backtesting (and tuning) any timed or racing sport against any prediction exchange with one set of code. It is the backtest counterpart of the multi-sport live design: - [Engine: Parity rebuild (all combos)](https://github.com/racinglines/racinglines/blob/main/docs/parity-rebuild.md): The plan for rebuilding every backtest and the paper-trading P&L with the F1-on-Polymarket pipeline, for every sport and exchange we cover. Staging first; prod only after the owner reviews staging. - [Engine: Input frames (engine E1)](https://github.com/racinglines/racinglines/blob/main/docs/frames.md): The first step of the Engine roadmap (phase E1): every sport's data in one declared shape, so a model can be written against the frames instead of one sport's tables. ## Operate - [VM deploy](https://github.com/racinglines/racinglines/blob/main/docs/vm-deploy.md): racinglines.bet runs on one Compute Engine VM, `racinglines-vm`: Postgres in docker, systemd units for the web app, the recorders and the live-event steps, and a Cloudflare tunnel (the VM opens no inbound port). - [Market tape (record and backfill)](https://github.com/racinglines/racinglines/blob/main/docs/market-tape.md): The tape is the business. Every edge we claim is measured against it: the sweeps and replays trade each exchange's recorded prices, the maker replay fills only against recorded taker trades, and paper signals and CLV … - [Race weekend runbook](https://github.com/racinglines/racinglines/blob/main/docs/weekend-data-runbook.md): Everything on a race weekend runs on timers (VM deploy: Timers and jobs): the market recorders every 5 minutes every day, `racinglines live auto` for every F1 event whose window is open, the signals pass every 5 … - [Live events](https://github.com/racinglines/racinglines/blob/main/docs/live-events.md): A race followed live in the web app: the first run was the UCI Downhill World Cup final at Whistler, 27 September 2026, as a demo experiment; - [Overnight VM run](https://github.com/racinglines/racinglines/blob/main/docs/overnight-vm-run.md): The plan below is the one written before the first run on 2026-09-30 and kept as the record, with the changes that run forced folded in. - [Cloud sweeps](https://github.com/racinglines/racinglines/blob/main/docs/cloud-sweep.md): A cloud session clones this repo, builds the database from the data bucket, and works through a queue of season sweeps in parallel while the agent steers the queue. - [Testing](https://github.com/racinglines/racinglines/blob/main/docs/testing.md): Three levels, fastest first: - [Email setup](https://github.com/racinglines/racinglines/blob/main/docs/email-setup.md): racinglines.bet has no mail today: no MX, SPF, DKIM or DMARC record, and no mail code in the web app. The fantasy soft launch needs it for two jobs. - [Plans: Cloud build-out](https://github.com/racinglines/racinglines/blob/main/docs/cloud-buildout.md): A long, unattended build session in a Claude Code cloud session, working through the Roadmap in priority order until nothing more can be done without a live event, the owner, or data the cloud machine can't reach. - [Plans: Google Cloud proposal](https://github.com/racinglines/racinglines/blob/main/docs/google-cloud.md): A proposal for moving racinglines off the owner's Mac onto Google Cloud, where the data bucket already lives. Nothing here is built yet: it's the plan and a cost estimate for the owner to decide on. - [Plans: Data off GitHub (plan)](https://github.com/racinglines/racinglines/blob/main/docs/data-off-github.md): Status: plan only (2026-09-30). Nothing here has run. No stage starts until the overnight Mac backfill and the F1 taker re-sweep have both finished (see In-flight work). - [Historical: VM reliability (pre-launch)](https://github.com/racinglines/racinglines/blob/main/docs/vm-reliability.md): Drafted on 29 Sep 2026 for the fantasy soft launch, and kept as the record. Of what it planned, the deploy pause-and-resume, the recorder and schedule timers, the backup-first rule for every writing script and staging … - [Historical: Fantasy launch runbook](https://github.com/racinglines/racinglines/blob/main/docs/fantasy-runbook.md): This is the sprint plan as drafted on 29 Sep 2026, kept as the record. What shipped is the fantasy league alpha on production (2026-10-12): ## Roadmap - [Priorities and open items](https://github.com/racinglines/racinglines/blob/main/docs/todo.md): The one place for what's next, across every sport and track, in priority order. Rebuilt on 2026-09-28 around the strategy to the end of 2026 and re-ranked on 2026-10-14 around the three goals the owner set (G1 to G3 … - [Strategy 2026 (demo plan)](https://github.com/racinglines/racinglines/blob/main/docs/strategy-2026.md): Findings from a working session on 28 September 2026 between the owner and Claude, over the racinglines MCP server (`overview`, `track_record`, `edge_finder`, `sql`) and the repo docs. - [F1 live test (round 16)](https://github.com/racinglines/racinglines/blob/main/docs/f1-live-roadmap.md): The working plan for the first live F1 test, kept up to date as we go. Tick items off as they land and add every decision to the decision log. The general F1 plan is the F1 roadmap (this test is its phase F1-8); - [F1 roadmap](https://github.com/racinglines/racinglines/blob/main/docs/f1-roadmap.md): A phased plan for extending the F1 model and market-making tools, written for a coding agent and the people reviewing its work. The concepts and links behind each phase are in the F1 reference. - [Engine roadmap (all sports)](https://github.com/racinglines/racinglines/blob/main/docs/engine-roadmap.md): Status: approved by the owner on 2026-09-29 (E0 done: decisions D1–D6 taken as recommended, see the decision log). Built so far: ## Background - [Project history](https://github.com/racinglines/racinglines/blob/main/docs/history.md): All of the work below happened in one Claude Code session, my first (vibe-)coding session with Claude, within the session credit limit of a basic paid plan. - [F1 reference](https://github.com/racinglines/racinglines/blob/main/docs/f1-reference.md): Background for the F1 roadmap: the model families and market-making strategies worth investigating, the knobs that matter, and how each maps onto what racinglines already does. - [PyPI page (example)](https://github.com/racinglines/racinglines/blob/main/docs/pypi-example.md): This is a draft of what the racinglines page on PyPI could look like. The package is not on PyPI: nothing has been uploaded and the name is not registered. Publishing waits for the owner's go. - [Publishing guide (PyPI, public repo)](https://github.com/racinglines/racinglines/blob/main/docs/release.md): How `racinglines` reaches PyPI and the public repo. Read The rules first. They are the owner's (18 Oct 2026), and every release, script and workflow below exists to keep them. - [Reports and notes: Strategy review (2026-10-06)](https://github.com/racinglines/racinglines/blob/main/docs/strategy-review.md): Profile A on Kalshi turned out to rest on two weekends a season (Kalshi history), so the owner asked for every F1 strategy so far to be backtested on Polymarket and Kalshi side by side, with rolling Kelly sizing on a … - [Reports and notes: Strategy opening preview](https://github.com/racinglines/racinglines/blob/main/docs/strategy-preview.md): `scripts/strategy_preview.py` is a standalone F1 diagnostic, not a trading command. It compares T1–T10 and TB's 50:50 T1/T8 opening blend, using an existing model run's forecast cutoff and cached Polymarket bid/ask … - [Reports and notes: Novig and a model bake-off](https://github.com/racinglines/racinglines/blob/main/docs/novig-and-model-bakeoff.md): Best-effort investigation, started 2026-10-06 on the owner's ask: two people, $50 each plus promo credits on Novig, and "a good time to A/B/C test the first-stage prediction models against each other (fundamentally … - [Reports and notes: Launch sprint (Oct 2026)](https://github.com/racinglines/racinglines/blob/main/docs/launch-sprint.md): One page for the week to the soft launch. Times are PDT with UTC in brackets. It narrows the larger Fantasy soft launch plan to the owner's minimum viable demo (owner, 2026-10-01 22:23Z): - [Reports and notes: Sports and exchanges, 48 hours](https://github.com/racinglines/racinglines/blob/main/docs/report-48h.md): From 2026-09-29 16:00Z to the morning of 1 Oct (UTC), most of the work went into one problem: getting the backfills for every sport and exchange to reach the production web app. - [Reports and notes: Sign-up test walkthrough](https://github.com/racinglines/racinglines/blob/main/docs/signup-test-walkthrough.md): One new user account from start to finish: sign up, login, logout, forgot password, admin reset, and cleanup. Runs on staging.racinglines.bet before the weekend (book Fri 2 Oct 03:30Z to Sun 7 Oct 07:00Z);