Engineering docs

Timed Trading

Cloudflare Workers + Pages product: live prices, scoring, three books, and broker mirroring. These pages are the public onboarding pack for engineers joining the repo.

Read left to right. Canonical playbooks still live in the git repo under skills/.

Day 1

Start here

Five-worker map, local run, auth tiers, price invariants, and a first-week checklist.

Open the newcomer guide
Day 2

Architecture

System diagram, deploy topology, security boundaries, and partner checklist.

Open architecture
Reference

Data dictionary

KV short keys, API ticker fields, D1 tables, sessions, tiers, Discord payloads. Searchable.

Open the dictionary

Keep these three straight

Pages ≠ workers

UI ships from react-app-dist/ on push to main. API and crons ship per Worker script via Wrangler. A green merge does not mean prod moved.

One codebase, five scripts

timed-trading-ingest owns HTTP + Durable Objects. tt-feed / tt-engine / tt-research are the same bundle, role-gated. The broker bridge is a separate tree.

Prices are licensed

Live quotes and proprietary scores go to Pro / VIP / Admin only. Members and anonymous callers are redacted. Daily change always goes through getDailyChange().

Freshness is q_ts

Every timed:prices row must stamp q_ts and p_ts. Never gate display on poll field t. Stuck-on-yesterday prices are almost always missing stamps.

Architecture

Full diagram notes, deploy table, and partner checklist

Timed Trading system architecture