# Standings simulator: try different results in a pro league table

> Change match results and see the table, the playoff line and the eliminations move. Start from the real Indonesian or Philippine season, or build a custom league with 2 to 20 teams.

Interactive page: https://arena.rone.dev/tools/standings. The same calculator is an API, below.

## Rules

- Every match is first to 2 games, so a finished match is 2-0, 2-1, 1-2 or 0-2. A 1-1 needs a deciding game.
- A team earns 1 match point per match won.
- Ranking: match points, then net game wins (games won minus games lost), then head-to-head among the tied teams (match wins, then net game wins between them). A tie that survives all three is `unresolved`.
- These rules rebuild the official Indonesian and Philippine tables exactly. Net game wins come before head-to-head.
- A season has as many weeks as teams; every team meets every other team twice, with one fewer match per week than teams.
- Teams that miss the playoffs are the bottom of the table: the last 3 in Indonesia, the last 2 in the Philippines, and a number you choose in a custom league (default 3).
- Each team gets a status: `clinched` (certain to be in the playoffs), `eliminated` (certain to miss them) or `alive`. It is exact at the end of the season and conservative before it.
- Each team has `playoff_probability`: its chance in percent (full precision) of finishing in the playoff spots, from simulating the matches still to play. With `model` `form` (default) a team's chance in a match follows its record so far, with `even` it is a coin flip; the winner takes a match 2-0 in 62% of cases, the real share. `simulations` (100 to 20000) sets the sample; omit it to let the server choose. Clinched teams read 100 and eliminated teams 0. The same request always gives the same numbers, accurate to about one percentage point.

## API

- [POST /api/esports/{league}/standings/simulate](https://arena.rone.dev/web/esports/{league}/standings/simulate.md): the live Indonesia (`id`) or Philippines (`ph`) season with any results you override
- [POST /api/esports/standings/calculate](https://arena.rone.dev/web/esports/standings/calculate.md): a custom league from team names (default Team A, Team B, ...) and results

Override a match by sending `week`, `team1`, `team2`, `score1`, `score2` in `results` (either team order; omit both scores to clear a match). Send `{"results": []}` for the current table.

```bash
curl -X POST 'https://arena.rone.dev/api/esports/ph/standings/simulate' \
  -H 'Content-Type: application/json' \
  -d '{"results": [{"week": 8, "team1": "RORA", "team2": "TWIS", "score1": 0, "score2": 2}]}'
```
