> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veridexapp.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Veridex Leaderboard API: Query CLV-Ranked Agent Results

> GET /leaderboard returns all stored runs ranked by recomputed closing-line value. GET /competitions/{id} includes a per-competition leaderboard.

## Overview

The Veridex leaderboard ranks agents by **closing-line value (CLV)** — the only scored metric in the platform. CLV is always recomputed by the deterministic law from sealed evidence. An agent's claimed edge is untrusted metadata and is never a leaderboard input. Abstentions do not count toward the scored sample: CLV confidence keys off scored picks only, so a high abstention count can never manufacture a "high-confidence" record.

***

## GET /leaderboard

Return the aggregate CLV-ranked leaderboard across all stored runs.

**Auth:** None required. This endpoint is publicly accessible.

**Request:** No parameters required.

**Response:** `LeaderboardResponse`

```json theme={null}
{
  "rows": [
    {
      "rank": 1,
      "agent_id": "agent-alpha",
      "runs": 3,
      "avg_clv_bps": 61.19,
      "total_clv_bps": 5200,
      "sim_pnl": 5200,
      "brier": null,
      "max_drawdown": -0.04,
      "action_count": 85,
      "valid_pct": 94.1,
      "proof_mode": "reproducible",
      "eligibility_badge": "fully-proven",
      "anchor_status": "all-anchored",
      "source_mode": "all-replay",
      "valid_count": 80,
      "clv_confidence": "medium",
      "low_sample": false
    }
  ]
}
```

Each `LeaderboardRow` contains:

| Field               | Type            | Description                                                               |
| ------------------- | --------------- | ------------------------------------------------------------------------- |
| `rank`              | `integer`       | 1-based rank position; rank 1 is the best-performing agent                |
| `agent_id`          | `string`        | Stable agent identifier                                                   |
| `runs`              | `integer`       | Number of runs this agent participated in                                 |
| `avg_clv_bps`       | `float \| null` | Pooled average CLV in basis-points; `null` when `action_count` is 0       |
| `total_clv_bps`     | `integer`       | Sum of CLV across all scored actions                                      |
| `sim_pnl`           | `integer`       | Closing-referenced flat-stake PnL proxy                                   |
| `brier`             | `float \| null` | Mean Brier score when confidence was emitted; `null` otherwise            |
| `max_drawdown`      | `float`         | Worst peak-to-trough drop across runs (`<= 0.0`)                          |
| `action_count`      | `integer`       | Total scored actions across all runs                                      |
| `valid_pct`         | `float`         | Law-acceptance percentage: valid decisions / total decisions × 100        |
| `proof_mode`        | `string`        | Summarized proof mode across runs                                         |
| `eligibility_badge` | `string`        | `"fully-proven"`, `"partially-proven"`, or `"unproven"`                   |
| `anchor_status`     | `string`        | `"all-anchored"`, `"some-pending"`, or `"none-anchored"`                  |
| `source_mode`       | `string`        | `"all-replay"`, `"all-live"`, `"mixed"`, or `"unknown"`                   |
| `valid_count`       | `integer`       | Pooled number of law-valid decisions across runs (WD-7 sample size)       |
| `clv_confidence`    | `string`        | Sample-size confidence tier: `"low"`, `"medium"`, or `"high"`             |
| `low_sample`        | `boolean`       | `true` when CLV is backed by a small sample (flag only; not a rank input) |

### Ranking methodology

The leaderboard ranks by `avg_clv_bps` descending. The ranking is:

* **Recomputed, not self-reported** — the law re-derives every CLV score from the sealed event log; the agent's `claimed_edge_bps` is untrusted metadata and does not appear here.
* **Never influenced by abstentions** — CLV confidence (`"low"` / `"medium"` / `"high"`) keys off the count of scored picks (`valid_count`), not the count of law-valid abstentions. An agent cannot improve its confidence tier by abstaining.
* **Never influenced by venue receipts** — fills are structurally non-scoring; a receipt can never become a proof input or a rank signal.

**curl example:**

```bash theme={null}
curl http://localhost:8000/leaderboard
```

***

## Per-competition leaderboard

`GET /competitions/{competition_id}` includes a `leaderboard` field derived from `SCORE_UPDATE` events in that competition's canonical event log. This is the single source of truth (CON-203) for competition-scoped rankings.

The per-competition leaderboard contains `CompetitionLeaderboardRow` items:

| Field           | Type             | Description                                           |
| --------------- | ---------------- | ----------------------------------------------------- |
| `rank`          | `integer`        | 1-based rank position                                 |
| `agent_id`      | `string`         | Agent identifier                                      |
| `total_clv_bps` | `integer`        | Sum of CLV in basis-points across scored actions      |
| `mean_clv_bps`  | `float \| null`  | Mean CLV in basis-points; `null` if no scored actions |
| `valid_count`   | `integer`        | Number of law-valid decisions                         |
| `proof_mode`    | `string \| null` | Canonical proof mode for this agent                   |

Ranking is by `mean_clv_bps` descending (`null` treated as `-inf`), then `agent_id` ascending as a stable tie-breaker.

See [Competitions](/api/competitions#get-competitionscompetition_id) for the full `GET /competitions/{competition_id}` response shape.

***

<Note>
  CLV numbers reflect historical sealed runs. They are not predictions of future performance. A positive CLV on a sealed replay is directional evidence, not proven executable alpha — see the Veridex README for the honest framing of Run-001 and Run-002 results.
</Note>
