Live, in-the-moment betting on discrete game events. While a match is on, the feed/AI spots a "set" moment (a penalty, a corner, an attack launching) and opens a short YES/NO market — "Argentina on the attack — GOAL?". You tap a side, the play happens, you get paid. Markets resolve in seconds, not weeks.
This repository is a working engineering prototype: a tested market engine, a simulated or live event feed with an AI watcher, a mobile client, and an on-chain settlement program.
Two hard problems sank the naive version; both are solved here:
-
Liquidity — we do not use a bonding curve (it can't pay winners without "buyers after you"). We use a parimutuel pool with a bet-time odds-lock: all YES/NO stakes pool, the house takes a fixed rake, winners split the pool, and the multiple you see is locked the instant you tap so late money can't dilute you. →
packages/core/src/parimutuel.ts -
Latency / fairness — you bet on the next discrete event before it happens, and the betting window locks before the play resolves. At lock time nobody — not even someone on a faster feed — knows the outcome, so there's no edge to pick off. The result is shown via tap-to-reveal so a delayed TV is never spoiled. →
packages/core/src/engine.ts,watcher.ts
┌─────────────────────── @golazo/core ───────────────────────┐
│ types · parimutuel(+odds-lock) · MarketEngine · watcher · sim · protocol │
└───────▲───────────────────▲──────────────────────▲─────────┘
│ imports │ imports │ mirrors math
┌───────────┴──────┐ ┌────────┴─────────┐ ┌────────┴──────────────┐
│ apps/mobile │ │ services/feed │ │ programs/ │
│ (Expo, iOS) │◀──│ feed + AI watcher │ │ golazo-parimutuel │
│ offline OR ws ──┼──▶│ ESPN→events→AI │ │ (Anchor / Solana) │
│ live │ │ →engine→WS+bots │ │ on-chain settlement │
└───────────────────┘ └───────────────────┘ └───────────────────────┘
feed event ──▶ watcher (AI or rules) ──▶ MarketTrigger ──▶ engine ──▶ Market ──▶ UI
Everything agrees on one set of types (@golazo/core), so the app, the service, and
the chain can't drift. The app runs fully offline on a simulated match, or
live against the service over WebSocket.
| Path | What it is | Run / verify |
|---|---|---|
packages/core |
Framework-agnostic domain core: pool math, odds-lock, market state machine, feed types, match simulator. Fully unit-tested. | npm test -w @golazo/core |
apps/mobile |
Expo + React Native (TypeScript) app, iOS-ready. Offline sim mode + live WS mode. | npm run mobile → press i |
services/feed |
Node service: pulls a real ESPN feed, AI watcher (Claude) phrases bettable moments, drives the engine, broadcasts over WebSocket, bots fill pools. Degrades to sim + rules with zero config. | npm run feed |
programs/golazo-parimutuel |
Anchor (Solana) program: on-chain parimutuel market + odds-lock that mirrors the core math exactly. | anchor test (needs toolchain) |
index.html |
The original single-file prototype (kept for reference). | open in a browser |
# 1. install everything (npm workspaces)
npm install
# 2. run the core tests (proves the pool math + odds-lock)
npm test
# 3a. play it offline — no backend needed
npm run mobile # Expo dev server; press i for iOS simulator
# 3b. OR run the live service in another terminal, then point the app at it
npm run feed # WebSocket on :8787, sim feed + rule watcher by default
# set ANTHROPIC_API_KEY to enable the Claude AI watcher
# set FEED_MODE=espn to pull a real live match from ESPNThe Solana program builds separately (it needs the Solana CLI + Anchor):
cd programs/golazo-parimutuel && npm install && anchor build && anchor testpackages/core/src/parimutuel.ts— the mechanism, with commentspackages/core/src/engine.ts— the market lifecyclepackages/core/src/watcher.ts— event → bettable marketapps/mobile/src/hooks/useGameFeed.ts— the live loop on-deviceservices/feed/src/orchestrator.ts— the same loop, server-side, with the real feed + AIprograms/golazo-parimutuel/src/state.rs— the same math, on-chain
- Built & verified: the core engine (12 passing tests, strict typecheck), the service in sim mode, the app code & monorepo wiring.
- Needs your toolchain: the iOS simulator (Xcode) and the Anchor build (Solana CLI).
- The "AI watching the game" is honest about what it does: it watches the structured event/commentary stream, not raw video — that's the fair, affordable version.
- This is an engineering prototype, not a production wagering service. A commercial release would require jurisdiction-specific legal review, licensed data feeds, integrity controls, payments compliance, and responsible-product safeguards.