One platform, two ways to live the 2026 World Cup — simulated fantasy duels and a live 2D match arena, both driven by the same real-time data source: the TxLINE feed on Solana.
📄 Technical Documentation
·
🎥 Demo Video
Important
Hackathon entry for the TxODDS World Cup 2026 → Consumer & Fan Experiences track. Devnet only, fictitious tokens — no real money moves. Not affiliated with FIFA; no official marks are used.
104 matches · 1 TxLINE feed · 2 modes · real-time arena + on-chain settlement
Tip
Try it in under a minute — no wallet, no gas. Open hatrick.xyz and sign in with an email — a Solana devnet wallet and test funds are set up for you automatically. Then open a pack or watch & bet the live match. Testing from a restricted region? Add ?geo=demo. · 🎥 Watch the 5-min demo
Hatrick is designed to read as more than a demo: it is a consumer product loop where real-time sports data becomes play, social viewing, and settlement. The judging shortcut is simple:
- Unique concept: one TxLINE-powered engine drives both a live match arena and fantasy duels, instead of shipping another leaderboard, prediction widget, or chatbot.
- Clear TxLINE dependency: scores, events, odds, snapshots, replay, settlement, and fantasy progression all flow from the same provider-shaped pipeline.
- Consumer-first UX: email sign-in creates a Solana wallet invisibly, so a non-crypto fan can enter, get test funds, open packs, and place devnet bets without wallet setup friction.
- Real-time credibility: the arena reacts to the feed live, and every bet settles from the authoritative TxLINE result — fast to watch, trustworthy to bet.
- Business path: Live betting margin, fantasy packs, market fees, and wallet retention form one economy instead of disconnected features.
Table of Contents
Hatrick turns the World Cup feed into a consumer game loop. Fans normally split their attention across score apps, fantasy tools, odds screens, and social feeds; Hatrick puts the core actions in one place: watch the match, bet the live market, collect cards, and play a squad duel.
- 🎮 Fantasy — open player packs, build your XI, and enter simulated 1v1 arena duels. Base cards are collectibles; live form and squad strength are informed by real player and team performance.
- 📺 Live — follow real matches as a 2D arena with play-by-play, odds, and in-match betting on one screen.
The defining mechanic: one authoritative feed drives everything on screen — the arena reacts to TxLINE in real time, and bets settle from its confirmed result. See Architecture.
TxLINE is the engine behind both modes, not just a logo in the footer.
| Mode | What TxLINE provides | What Hatrick turns it into |
|---|---|---|
| Fantasy | Player stats, lineups, goals, cards, shots, corners, and confirmed final results | Card form, squad strength, duel inputs, player context, and replayable fantasy moments |
| Live | Real-time score events, match clock, play-by-play actions, odds updates, snapshots, and confirmed results | 2D arena motion, event feed, odds board, bet slip, settlement, and late-join state recovery |
The value is the same signed feed creating two products: Live makes the match watchable and bettable now; Fantasy keeps the fan economy active around the clock, match or no match.
|
Follow real matches as a 2D real-time arena shaped by the TxLINE feed, with live odds and in-match bets settled by the authoritative result. |
|
Build your XI from the cards you own and stake in a simulated 1v1 arena duel rendered by the custom canvas engine. Card ratings and TxLINE-informed form seed the simulation — challenge a friend or get matched; the wager settles to the winner and the result is provable. |
- API: NestJS ·
@nestjs/event-emitter(event-driven) · Socket.IO · Axios - Front: Next.js (App Router) · shadcn/ui · Zustand · React Query · Solana Wallet Adapter · custom canvas game engine (framework-free TS)
- Data: TxLINE (SSE scores + odds, REST snapshots, oracle-signed settlement inputs) — see Data & Architecture
- Chain: Solana (devnet) · Anchor programs for betting, fantasy duels, packs, and provably-fair seeds
- Infra: Docker (Postgres + Redis) · GitHub Actions CI
Everything you see in Hatrick originates from TxLINE, TxODDS' real-time World Cup data product. There is no scraped or invented match data: one feed, one ingest path, many consumers.
| Source | What it carries | How we use it |
|---|---|---|
| TxLINE SSE — scores | Live match events (goals, cards, corners, possession…) with a confirmed flag |
The heartbeat of the whole app |
| TxLINE SSE — odds | Real-time market prices | Odds boards + in-match betting markets |
| TxLINE REST snapshots | Fixtures, lineups, current state | Fixture pages, initial state on connect |
| Solana devnet | TxLINE token activation plus Hatrick Anchor programs for betting, fantasy duels, card packs, and provably-fair seeds | Access to the feed is provisioned on-chain; app flows can run in play-money mode or chain-authoritative mode |
TxLINE SSE (scores + odds)
▼
[api] ingest → normalizer → in-memory match state
▼
EventEmitter2 ─► listeners (fantasy attributes · live markets · settlement)
▼
[api] WebSocket gateway ──► [front] one WS → Zustand stores → surfaces
▼
arena animates in real time · bets settle on TxLINE's confirmed result
The core idea: one authoritative feed drives every surface. TxLINE events flow through a single normalizer into an in-memory match state, fan out to listeners (live markets, fantasy attributes, settlement), and reach the frontend over one WebSocket. The arena reacts the instant an event arrives; bets settle from TxLINE's confirmed result. One pipeline feeding every screen — instant to watch, authoritative when it counts.
- Live: score events animate the arena; odds updates price the board; confirmed results settle bets.
- Fantasy: player/team performance updates card form and squad strength once events are confirmed.
- Replay: finished matches run through the same pipeline, so demos show real TxLINE behavior without waiting for kickoff.
📄 Go deeper — full technical documentation. The complete writeup lives in
docs/technical-documentation.md: the event-driven architecture, the full list of TxLINE endpoints we use, the wire-format gotchas we solved (score truth, regulation vs. extra time, naming events, gap-filling), and how the four Solana programs handle betting, duels, packs, and provably-fair seeds.
How Hatrick answers each judging criterion of the track:
| Criterion | How Hatrick answers it |
|---|---|
| Fan Accessibility & UX | One platform instead of three tabs: watch, play, and bet share one profile, wallet, and design system. Two clear modes from a single home; built for a non-technical fan. |
| Real-Time Responsiveness | Real-time by design: the arena animates the instant an event arrives and settles from TxLINE's confirmed result. One SSE ingest → WebSocket fan-out to every surface. |
| Originality & Value Creation | Not another picks leaderboard or pundit bot — a playable match simulation driven by real data. Live matches become a 2D arena; fantasy cards get stronger from real performances; both are the same engine fed by the same feed. |
| Commercial & Monetization Path | A closed economy with real monetization hooks: betting margin (Live), pack sales and market fees (Fantasy), and a wallet ledger connecting them. Responsible gaming built in (18+ gate, self-exclusion, stake limits) — table stakes for anything odds-adjacent. |
| Completeness & Execution | Functional end-to-end today: on-chain TxLINE token activation, four Anchor programs, live ingest, betting with settlement, pack → XI → 1v1 duels, replay for demos. Devnet, no real money. |
And the hard requirements: TxLINE as live input ✅ · Solana sign-up ✅ (wallet = Competitor account) · functional product, not a mockup ✅ · public repo + ≤5-min demo video with the submission.
🔗 Proof it's on-chain: program ids, deploy commands, and verification steps live in
contracts/README.md— and every pack buy, bet, and settlement in the app links straight to Solscan (devnet).
A polyglot monorepo of independent apps — nothing shared, no cross-app imports. Run each app on its own.
- Node.js 20+
- Docker (for Postgres + Redis)
- (optional) A Solana wallet such as Phantom — email sign-in works without one
- Rust, Solana CLI 2.2.16, and Anchor 0.31.1 when building or deploying
contracts/
# 1) API + infra (run from project/)
cd api
docker compose up -d # postgres :5432 + redis :6379
npm install # postinstall runs `prisma generate`
cp .env.example .env # set TXLINE_* to ingest live data
npm run prisma:deploy # apply migrations to a fresh DB
npm run start:dev # http://localhost:3001/health
# 2) Front (separate terminal)
cd front
npm install
cp .env.example .env.local
npm run dev # http://localhost:3000
# 3) Contracts (only when deploying or testing on-chain mode)
cd ../contracts
yarn install
anchor build --release
yarn test # local validator-backed Anchor testsThe API boots cleanly with
TXLINE_ENABLED=falseandSOLANA_ENABLED=false(no credentials needed). Seeapi/README.mdfor TxLINE and chain setup, andcontracts/README.mdfor Anchor build/deploy instructions.
| App | Stack | Port | Status |
|---|---|---|---|
api/ |
NestJS, event-driven (TxLINE → DURING/AFTER → WebSocket) | 3001 | active |
front/ |
Next.js (App Router) + shadcn/ui + Zustand + React Query | 3000 | active |
contracts/ |
Anchor / Solana (devnet): betting, fantasy, packs, provably-fair seeds | — | active |
project/
├─ api/ # NestJS — event-driven, TxLINE ingest, WS gateway (+ docker-compose)
├─ front/ # Next.js — shadcn, Zustand, React Query, services/
└─ contracts/ # Anchor / Solana — betting, fantasy duels, packs, provably-fair seeds
- Monorepo scaffold (api + front), governance docs, CI, Docker infra
- Event-driven core — real-time ingest, one WebSocket fan-out, authoritative settlement
- TxLINE integration — on-chain token activation, SSE ingest, snapshots, match replay through the live pipeline
- Live Mode — feed-driven 2D arena, live odds board, markets, in-match betting + settlement
- Fantasy Mode — packs, XI builder, dynamic attributes, 1v1 arena duels
- Responsible gaming — 18+ age gate, self-exclusion, stake limits
- Geo-blocking on betting surfaces (
proxy.ts,?geo=demobypass) - Contracts — Anchor programs for betting escrow, fantasy duel escrow, card packs, and provably-fair seeds
- Public deploy — live at hatrick.xyz + demo video with the submission
- On-chain proof — Solscan receipts for pack buys, bets, and settlements (devnet)
- Live social feed — real-time Events play-by-play with player names, HatBot reactions on the big beats, and live viewer picks across Live and Fantasy
- More matches & leagues — grow past the World Cup into TxODDS' wider catalog (350+ leagues, 30+ sports); ingest is league-agnostic, so activating a competition is config (
POST /token/activate {leagues}), not a rewrite - Crowd at scale — multi-user chat with moderation & ranking, plus X-style social balloons
- No FIFA IP — no official branding, logos, marks, or implied affiliation.
- Devnet only — fictitious tokens; no real-money movement during the hackathon.
- Geo-blocking — betting surfaces restrict regulated jurisdictions.
- Natural-person authorship — AI used as a tool; a human team owns the submission.
Distributed under the MIT License. See LICENSE.txt for details once the license file is added to the repository.
![]() Kauã Miguel Owner · @Kc1t |
![]() Deborah Pavanelli Colicchio Member · @eudehh |
![]() Pedro Henrique Member · @opedrooz |
Team Hatrick · X: @playhatrick · Repository: https://github.com/project-hattrick/hatrick









