Skip to content

examples: tennis market monitor with live match-state overlay - #26

Open
bensynapse wants to merge 1 commit into
NYTEMODEONLY:mainfrom
bensynapse:main
Open

examples: tennis market monitor with live match-state overlay#26
bensynapse wants to merge 1 commit into
NYTEMODEONLY:mainfrom
bensynapse:main

Conversation

@bensynapse

Copy link
Copy Markdown

What this adds

examples/tennis_market_monitor.py — a new runnable example that mirrors examples/simple_monitor.py. It watches Polymarket tennis events through PolyTerm's own GammaClient and overlays an independent, read-only live match-state annotation (score, who's serving, break point) next to each market.

It follows the existing example pattern exactly:

  • standalone script under examples/, Config() + GammaClient(...) construction like simple_monitor.py;
  • reuses polyterm.api.market_utils.market_probability_price / parse_list_field for the Polymarket side (no new market-data path);
  • read-only: it places no orders and imports no execution code — the live feed is only a display overlay.

Data sources

  • Polymarket market data: PolyTerm's GammaClient (unchanged; the sole market-data source here).
  • Live match state: the Live Tennis API free tier (GET /matches?status=live), used purely as an external score/status annotation.

Vendor disclosure

I run the Live Tennis API (https://livetennisapi.com), so this example is vendor-authored — please judge accordingly. It positions the feed as an independent live-score/status source for debugging/annotating a market's inputs, never as an oracle, venue, or resolution source; the module docstring tells readers to confirm official resolution criteria on the Polymarket page. The free keyed tier (https://livetennisapi.com/subscribe/free) covers live matches + scores at 30 req/min, 100 req/day — enough for a develop-and-test or ~15-minute-cadence check, not continuous fast polling. The overlay is opt-in via LIVETENNIS_API_KEY; with no key set, the script prints the Polymarket side only. Happy to hand a maintainer a free key to try it.

Checks run locally

  • Repo's CI syntax check over polyterm/ — passes.
  • Example parses and all imports resolve in a fresh venv (pip install -e .).
  • The derive_break_point helper is verified offline against the documented convention (receiver at AD, or receiver at 40 vs server 0/15/30; never in a tiebreak; null-safe on null server/points).
  • pytest tests/ --ignore=tests/test_live_data --ignore=tests/test_tui/test_integration.py1116 passed, 1 skipped. (The 11 test_agent_mcp.py failures are a pre-existing mcp-package version guard in polyterm/agent/mcp/fastmcp_server.py, unrelated to this change — the new file is only added under examples/ and is imported by no test.)

grep -riE "casino|gambling" over the diff is empty.

Adds examples/tennis_market_monitor.py, mirroring examples/simple_monitor.py:
PolyTerm's GammaClient remains the sole Polymarket data source, and the script
overlays an independent, read-only live-score/server/break-point annotation on a
tennis event. Read-only — no order or execution code is touched.

Co-Authored-By: Claude Opus 4.8 <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