Greyhound Trading API | System Architecture Blueprint

High-Frequency Trading & Betting API

A comprehensive architecture for UK/IE/NZ/AU greyhound markets. Built for ultra-low latency, deterministic reproducibility, and operational safety.

Target Latency
<100 ms
Critical Pipeline
Event Frequency
150 / day
~15k events/sec peak
Integrity
Deterministic
Immutable Event IDs
Risk Control
Pre-Trade
Server-side Gating

Core Design Principles

Immutable Event IDs: Versioned updates (e.g., reserve runner in) ensure data consistency across live and backtest environments.
Backtest Parity: Simulation engine consumes the exact same normalized event stream as the production trading engine.
Separation of Concerns: Read-only market data paths are strictly isolated from stateful trading/execution paths.
Idempotency: All endpoints safely support retries, crucial for handling distributed system failures.

System Blueprint

Interact with the system diagram below to explore the data pipeline, from raw feed ingestion to order execution. The architecture prioritizes a Batch/Stream Hybrid design to handle high frequency updates.

Ingest
Raw Feeds
Video, Price, Result
Normalizer
Kafka / Flink
Store & Signal
Canonical Store
Immutable IDs
Model Scoring
Batch & Online
Access
Streaming API
WebSocket / gRPC
REST API
Management
Execute
Risk Gate
Pre-Trade Checks
Order Router
Exchange Adapters

Select Component

Click any block in the diagram to view its technical specifications, data responsibilities, and key constraints.

System Component v1.0

Canonical Data Model

The backbone of the system. All endpoints and historical replay logs use these exact schemas.

The Race Entity

The `race_id` is globally unique and immutable. However, the race object is versioned. If a runner is replaced or a declared time changes, `race_version` increments.

  • Globally Unique ID: Prevents collisions across meetings.
  • Versioning: `version` and `changed_at` fields track lifecycle edits.
  • Runner Metadata: Includes permanent stats like `age_months` and `trainer_id` for ML features.
JSON

// Select a tab to view the schema

                    

SLA & Latency Architecture

Pipeline Latency Targets

* End-to-end latency from Exchange Pub to Client Sub

Client Type Rate Limit SLA
Streaming (Premium) Unlimited Subs ≤ 100 ms
Snapshot (REST) 60 req/sec ≤ 200 ms
Orders 20 req/sec ≤ 100 ms Ack

Deterministic vs. Speed

We prioritize Replayability. Normalization adds ~5ms but allows perfect backtesting parity, crucial for model debugging.

Colocation

Optional Enterprise tier. Reduces latency by ~40ms but increases operational complexity. Only recommended for arb strategies.

Implementation Roadmap

Phase 0

Foundation
1

Phase 1

Streaming
2

Phase 2

Execution
3

Phase 3

Models
4

Phase 4

Enterprise