# Tennis Match Winner Monte Carlo (`commodus67/tennis-match-winner-monte-carlo`) Actor

Monte Carlo win probabilities for live and upcoming ATP/WTA singles matches, compared against real-time Kalshi KXATPMATCH/KXWTAMATCH prediction-market prices to surface value edges.

- **URL**: https://apify.com/commodus67/tennis-match-winner-monte-carlo.md
- **Developed by:** [ELIO LIBERATORE](https://apify.com/commodus67) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 match projections

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## ATP/WTA Tennis Match Winner Monte Carlo + Kalshi

Live and upcoming ATP and WTA singles matches, projected with a Monte Carlo
model built on each player's current ranking points, compared against
[Kalshi](https://kalshi.com) `KXATPMATCH` / `KXWTAMATCH` prediction-market
prices to surface edge.

### What it does

For every singles match on today's ATP and/or WTA scoreboard:

1. Pulls both players' current ATP/WTA ranking points.
2. Estimates a pre-match win probability with a Bradley-Terry model on those
   points (calibrated against live Kalshi prices).
3. If the match is already in progress, converts that pre-match probability
   into an equivalent per-set probability and Monte Carlo-simulates the sets
   remaining from the current score — so a player already up a set shows a
   higher win probability than the pre-match number, without needing
   point-by-point data.
4. Optionally fetches the live Kalshi market for that match and reports the
   model's edge over the market price, a VALUE/WATCH verdict, and a
   suggested (half-Kelly by default) stake sized to your bankroll.

### Output

One row per player per match. Key fields: `player`, `opponent`,
`winProbability`, `method` (`pre-match` or `live-simulation`), and, when
market comparison is on, `kalshiYesAsk`, `edge`, `verdict`
(`VALUE`/`WATCH`/`NO_MARKET`/`ILLIQUID`) and `suggestedStake`.

Two dataset views: **Match overview** (probabilities only) and **Market
edge** (the Kalshi comparison columns).

### Input

See the input schema for the full list. The defaults run both tours, compare
against Kalshi, and use half-Kelly sizing with no bankroll set (so you get
edges without stake suggestions until you set one).

### Method notes

- **Strength**: live ATP/WTA ranking points (`site.api.espn.com`), not a
  full-season stat line — there's no separate strength signal to fall back
  on for tennis the way there is for a team's point differential.
- **Format**: best-of-3 everywhere except the men's Grand Slams
  (Australian Open, Roland Garros, Wimbledon, US Open), which are best-of-5.
  Every WTA event, including the women's Slams, is best-of-3.
- **Uncertainty**: the raw ranking-based probability is blended toward a
  coin flip by `strengthUncertainty` (default 0.15) to hedge against
  surface, current form, H2H and injuries — none of which ranking points
  alone can see.
- Qualifying-round matches are excluded by default (`includeQualifying`),
  since they rarely have a Kalshi market to compare against.

This Actor is a research tool. It does not place trades and is not
financial advice.

# Actor input Schema

## `leagues` (type: `string`):

Which tour(s) to scan.

## `includeMarketComparison` (type: `boolean`):

Fetch live KXATPMATCH/KXWTAMATCH prices and compute edge/value verdicts. Turn off for a model-only run (no Kalshi calls).

## `iterations` (type: `integer`):

Simulations run per LIVE match (matches already in progress). Pre-match projections use an exact closed-form calculation and ignore this.

## `rankingSensitivity` (type: `number`):

Bradley-Terry exponent on ranking points. 1.0 = plain points ratio (the calibrated default, 24 Sep 2026). Higher makes the model more confident in the higher-ranked player; lower flattens it.

## `strengthUncertainty` (type: `number`):

Blends the raw ranking-based probability toward a coin flip (0 = trust the model fully, 1 = always 50/50). Hedges against surface, form and H2H that ranking points alone can't see.

## `unrankedPoints` (type: `integer`):

Ranking points assigned to a player with no current ATP/WTA ranking (qualifier, wildcard, outside the top 150).

## `edgeThreshold` (type: `number`):

Minimum fee-adjusted edge (model probability minus Kalshi ask minus fee) to mark a row VALUE instead of WATCH.

## `bankroll` (type: `number`):

Used only to size suggested Kelly stakes. Leave at 0 to see edges without position sizing.

## `maxPerPositionPct` (type: `number`):

Caps a single suggested Kelly stake as a fraction of bankroll, even if the fractional-Kelly formula suggests more.

## `maxTotalExposurePct` (type: `number`):

Caps total suggested exposure across all open positions as a fraction of bankroll.

## `kellyFractionMultiplier` (type: `number`):

0.5 = half-Kelly (conservative default). 1.0 = full Kelly.

## `minMarketOpenInterest` (type: `integer`):

Markets with less open interest than this are marked ILLIQUID instead of being scored for edge. Most match-winner markets sit near zero until the day of the match.

## `maxMatchesPerLeague` (type: `integer`):

Limits how many matches per tour (ATP/WTA) are scanned per run, to bound cost on days with many simultaneous tournaments. 0 = no cap.

## `includeQualifying` (type: `boolean`):

Off by default: qualifying-round matches rarely have a Kalshi KXATPMATCH/KXWTAMATCH market, so including them adds chargeable rows with no market comparison.

## `archiveToNamedDataset` (type: `string`):

Optional. If set, every row is ALSO appended to a named dataset with this name (kept indefinitely, unlike the default 31-day run dataset) for building a running history.

## Actor input object example

```json
{
  "leagues": "both",
  "includeMarketComparison": true,
  "iterations": 20000,
  "rankingSensitivity": 1,
  "strengthUncertainty": 0.15,
  "unrankedPoints": 200,
  "edgeThreshold": 0.05,
  "bankroll": 0,
  "maxPerPositionPct": 0.02,
  "maxTotalExposurePct": 0.2,
  "kellyFractionMultiplier": 0.5,
  "minMarketOpenInterest": 5,
  "maxMatchesPerLeague": 0,
  "includeQualifying": false,
  "archiveToNamedDataset": ""
}
```

# Actor output Schema

## `matches` (type: `string`):

One row per player per match, with the model probability, live Kalshi price and edge/value verdict.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("commodus67/tennis-match-winner-monte-carlo").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("commodus67/tennis-match-winner-monte-carlo").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call commodus67/tennis-match-winner-monte-carlo --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,commodus67/tennis-match-winner-monte-carlo"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/j1R2ui5ADNMuA1i1A/builds/3zUMua8PAdndtG2Ut/openapi.json
