Skip to content

Add a sports (live tennis) domain adapter + specialist, mirroring weather - #20

Open
bensynapse wants to merge 1 commit into
howdymary:mainfrom
bensynapse:add-tennis-sports-domain
Open

Add a sports (live tennis) domain adapter + specialist, mirroring weather#20
bensynapse wants to merge 1 commit into
howdymary:mainfrom
bensynapse:add-tennis-sports-domain

Conversation

@bensynapse

Copy link
Copy Markdown

What

Adds a sports domain as a sibling to finance / weather / politics, following the existing domain plugin pattern exactly:

  • autopredict/ingestion/sports/ — normalizes live tennis match state into the shared IngestionBatch shape (normalize_match_states), with a deterministic build_sports_features and a local derive_break_point (receiver at AD, or 40 vs server 0/15/30; never in a tiebreak; false when server/points are unknown). build_match_state_row maps a raw GET /matches?status=live item into the row shape.
  • autopredict/domains/sports/SportsDomainAdapter (mirrors weather/adapter.py) + TennisSpecialistStrategy (mirrors weather/strategy.py), defaulting to MarketImpliedNoEdgeModel via build_default_sports_model (mirrors weather/model.py).
  • Wires tennis_specialist into domains/router.py (domain/category == sports, and MarketCategory.SPORTS already exists) and into create_default_registry().
  • Tests mirroring test_ingestion_weather.py / test_domain_adapters.py / test_domain_strategies.py (tests/test_ingestion_sports.py, tests/test_domain_sports.py, plus sports_match_state_rows in tests/domain_rows.py).
  • docs/STRATEGIES.md + docs/DATASETS.md entries and an observe-only examples/custom_strategy/tennis_agent.py (+ run_tennis.py, README section).

Why it respects the repo's philosophy

The default sports model is the market-implied no-edge model, exactly like the other specialists — so it returns the venue's own probability and HOLDs rather than inventing alpha. The example is observe-only: it prints the neutral forecast and a HOLD and places no orders. This mirrors your "conservative by design / no synthetic alpha" default; a verified model is required to trade.

Data source and disclosure

The match-state features come from the Live Tennis API (https://livetennisapi.com). I run the Live Tennis API, so this is vendor-authored — judge accordingly. It is a live-tennis data provider, not a market or execution venue: this contributes a data input for a strategy trading tennis event markets on your existing venue client, and it ships no proven fair-value model (hence the neutral default).

Endpoints used (all documented in docs/DATASETS.md):

  • GET /matches?status=live — FREE: live score, current server, status/event_status (retirement/walkover).
  • GET /matches/{matchId}/score — FREE snapshot; win_probability_p1 is ULTRA-only and stays None on lower tiers (never fabricated).
  • A free key (https://livetennisapi.com/subscribe/free) is 30 req/min, 100 req/day — fine for develop-and-test, not continuous fast polling. Happy to hand a maintainer a key to try it.

Checks

  • pytest463 passed (8 new).
  • black --check — clean on all touched files.
  • mypy — the new autopredict/domains/sports + autopredict/ingestion/sports are clean; the 14 pre-existing errors on main are unchanged (the router no-any-return pattern already applies to every specialist branch).

Vendor-authored, one-time contribution — no obligation to merge; feedback welcome.

Adds a `sports` domain sibling to finance/weather/politics, following the
existing domain plugin pattern:

- autopredict/ingestion/sports: normalize live tennis match state into the
  shared IngestionBatch shape, with a deterministic feature builder and a
  local break-point derivation (receiver at AD, or 40 vs server 0/15/30;
  never in a tiebreak).
- autopredict/domains/sports: SportsDomainAdapter + TennisSpecialistStrategy,
  defaulting to the production-safe market-implied no-edge model so a packaged
  example never fabricates alpha.
- Wire tennis_specialist into the router (domain/category "sports") and the
  default strategy registry.
- Tests mirroring the weather ingestion/adapter/strategy tests.
- docs/STRATEGIES.md + docs/DATASETS.md entries and an observe-only
  examples/custom_strategy/tennis_agent.py walkthrough.

The match-state features are supplied by the Live Tennis API
(https://livetennisapi.com), a live-tennis DATA provider — this is a data
input to a strategy that trades tennis event markets on the existing venue
clients, not a market or execution venue. Vendor-authored; judge accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant