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

# Compare MEV Timing

> Compare MEV timing behavior across the network, staking entities, sub-entities, and your validator sets

## Overview

MEV timing is most useful as a comparison. A single late proposal may be noise, but a sustained difference from the network can reveal deliberate timing behavior, relay latency, or a configuration change.

This guide shows three complementary workflows:

1. Compare an entity's daily timing trend with the network over the same UTC dates.
2. Compare your own validator set with the network per day.
3. Profile your own validator set with a rolling 180-day timing label and histogram.

> [!NOTE]
>
> **API Endpoints:** This guide uses [`/api/v2/ethereum/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/mev-timing), `/api/v2/ethereum/entity/mev-timing` (deprecated), [`/api/v2/ethereum/validators/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing), and [`/api/v2/ethereum/validators/mev-timing-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing-aggregate).

> [!NOTE]
>
> The entity and validator daily endpoints require a Scale or Enterprise plan. You can query the validator aggregate with explicit validator identifiers or your dashboard on free plans.

> [!WARNING]
>
> **The `entity/mev-timing` endpoint and the `entity` validator selector are deprecated** and will be sunset; after that, requests that use them answer `410 Gone`. The steps below still use them. [`/api/v2/ethereum/validators/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing) with the `entities` validator selector returns the same daily rows for an entity; [Migrating to Owners and Operators](https://docs.beaconcha.in/api/migrations/owners-and-operators.md) gives the date and describes every change.

***

## Comparison Strategy

Use the daily network and entity series for like-for-like date comparisons, and use the validator aggregate when its rolling 180-day window matches your question. Report sample size and relay coverage with every result; inspect the distribution when a median could hide mixed behavior or long tails.

API references: [Network timing](https://docs.beaconcha.in/api-reference/ethereum/mev-timing.md), [validator timing per day](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing.md), and [validator aggregate](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing-aggregate.md).

> [!WARNING]
>
> Do not average daily medians to create a period median. Medians are not additive. Aggregate the histogram for an approximate period distribution, or use the validator aggregate when its rolling 180-day window matches your question.

> [!WARNING]
>
> The timing bands describe pre-Glamsterdam slots only. From the Glamsterdam (Gloas) fork epoch on, validator labels are `not_applicable` and the daily series end at the fork, because relay timing no longer measures proposer timing under ePBS. For proposals from the fork on, [`POST /api/v2/ethereum/validators/proposal-timing-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/proposal-timing-aggregate) gives when one beaconcha.in node received the blocks of a validator set, a measure not comparable with relay timing. Relay timing is also offchain observation data, not independently verifiable onchain. Compare like-for-like protocol eras, report relay-data coverage, and treat missing observations as an uncertainty rather than evidence that no timing game occurred.

***

## Compare an Entity with the Network

Request both daily series with the same timestamp range. The example uses June 2026. The examples request 10 days per page (`page_size` can go up to 50 for the network series and up to 100 for the entity and validator series), so the Python and JavaScript examples below follow `paging.next_cursor` to collect all 30.

### Network Request

```bash theme={null}
curl --request POST \
  --url https://beaconcha.in/api/v2/ethereum/mev-timing \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chain": "mainnet",
  "range": {
    "timestamp": {
      "start": 1780272000,
      "end": 1782863999
    }
  },
  "min_slots_per_day": 100,
  "page_size": 10
}
'
```

### Entity Request

```bash theme={null}
curl --request POST \
  --url https://beaconcha.in/api/v2/ethereum/entity/mev-timing \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chain": "mainnet",
  "entity": "Lido",
  "range": {
    "timestamp": {
      "start": 1780272000,
      "end": 1782863999
    }
  },
  "page_size": 10
}
'
```

Entity and sub-entity names are case-sensitive. Get the canonical spelling from the `entities` and `entity/sub-entities` endpoints, which are deprecated (see [Migrating to Owners and Operators](https://docs.beaconcha.in/api/migrations/owners-and-operators.md)). Add `"sub_entity": "<NAME>"` to scope the second request.

### Calculate Daily Deltas with Python

```python theme={null}
import os

import requests

BASE_URL = "https://beaconcha.in/api/v2/ethereum"
HEADERS = {
    "Authorization": f"Bearer {os.environ['BEACONCHAIN_API_KEY']}",
    "Content-Type": "application/json",
}
RANGE = {
    "timestamp": {
        "start": 1780272000,
        "end": 1782863999,
    }
}


def post_all(path, payload):
    """Request every page of a daily series by following paging.next_cursor."""
    rows = []
    cursor = ""
    while True:
        body = {**payload, "cursor": cursor} if cursor else payload
        response = requests.post(
            f"{BASE_URL}/{path}", headers=HEADERS, json=body, timeout=30
        )
        response.raise_for_status()
        page = response.json()
        rows.extend(page["data"])
        cursor = page.get("paging", {}).get("next_cursor", "")
        if not cursor:
            return rows


def timing_game_share(row):
    denominator = row["slots_with_relay_winners"]
    if denominator == 0:
        return None
    breakdown = row["timing_breakdown"]
    delayed = breakdown["timing_games"] + breakdown["aggressive_tg"]
    return delayed / denominator


network_rows = post_all(
    "mev-timing",
    {
        "chain": "mainnet",
        "range": RANGE,
        "min_slots_per_day": 100,
        "page_size": 10,
    },
)
entity_rows = post_all(
    "entity/mev-timing",
    {
        "chain": "mainnet",
        "entity": "Lido",
        "range": RANGE,
        "page_size": 10,
    },
)

network_by_date = {row["date"]: row for row in network_rows}

for entity_row in sorted(entity_rows, key=lambda row: row["date"]):
    network_row = network_by_date.get(entity_row["date"])
    if network_row is None:
        continue

    entity_share = timing_game_share(entity_row)
    network_share = timing_game_share(network_row)
    if (
        entity_share is None
        or network_share is None
        or entity_row["median_slot_offset_ms"] is None
        or network_row["median_slot_offset_ms"] is None
    ):
        continue

    median_delta = (
        entity_row["median_slot_offset_ms"]
        - network_row["median_slot_offset_ms"]
    )
    share_delta = entity_share - network_share

    print(
        entity_row["date"],
        f"median delta: {median_delta:+.0f} ms",
        f"timing-game share delta: {share_delta:+.2%}",
        f"entity sample: {entity_row['slots_with_relay_winners']}",
    )
```

### Calculate Daily Deltas with JavaScript

This example uses the built-in `fetch` available in Node.js 18 and later.

```javascript theme={null}
const baseUrl = 'https://beaconcha.in/api/v2/ethereum'
const headers = {
  Authorization: `Bearer ${process.env.BEACONCHAIN_API_KEY}`,
  'Content-Type': 'application/json',
}
const range = {
  timestamp: {
    start: 1780272000,
    end: 1782863999,
  },
}

// Request every page of a daily series by following paging.next_cursor.
async function postAll(path, payload) {
  const rows = []
  let cursor = ''

  do {
    const response = await fetch(`${baseUrl}/${path}`, {
      method: 'POST',
      headers,
      body: JSON.stringify({ ...payload, ...(cursor && { cursor }) }),
    })

    if (!response.ok) {
      throw new Error(`${response.status} ${await response.text()}`)
    }

    const page = await response.json()
    rows.push(...page.data)
    cursor = page.paging?.next_cursor ?? ''
  } while (cursor)

  return rows
}

function timingGameShare(row) {
  const denominator = row.slots_with_relay_winners
  if (denominator === 0) return null

  const delayed = row.timing_breakdown.timing_games
    + row.timing_breakdown.aggressive_tg
  return delayed / denominator
}

const [networkRows, entityRows] = await Promise.all([
  postAll('mev-timing', {
    chain: 'mainnet',
    range,
    min_slots_per_day: 100,
    page_size: 10,
  }),
  postAll('entity/mev-timing', {
    chain: 'mainnet',
    entity: 'Lido',
    range,
    page_size: 10,
  }),
])

const networkByDate = new Map(networkRows.map(row => [row.date, row]))

for (const entityRow of entityRows.sort((a, b) => a.date.localeCompare(b.date))) {
  const networkRow = networkByDate.get(entityRow.date)
  if (!networkRow) continue

  const entityShare = timingGameShare(entityRow)
  const networkShare = timingGameShare(networkRow)
  if (
    entityShare === null
    || networkShare === null
    || entityRow.median_slot_offset_ms === null
    || networkRow.median_slot_offset_ms === null
  ) continue

  const medianDelta = entityRow.median_slot_offset_ms
    - networkRow.median_slot_offset_ms
  const shareDelta = entityShare - networkShare

  console.log({
    date: entityRow.date,
    median_delta_ms: medianDelta,
    timing_game_share_delta: shareDelta,
    entity_sample: entityRow.slots_with_relay_winners,
  })
}
```

> [!NOTE]
>
> Daily rows can have `median_slot_offset_ms: null` when there are no identified relay winners. The examples skip those rows before calculating deltas.

***

## Compare Your Validator Set per Day

[`/api/v2/ethereum/validators/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing) returns the same daily rows as the entity series for any validator selector: a validator list, dashboard, dashboard group, withdrawal credential or address, deposit address, or an owner or operator with the `entities` selector. Request it with the same timestamp range as the network series.

```bash theme={null}
curl --request POST \
  --url https://beaconcha.in/api/v2/ethereum/validators/mev-timing \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chain": "mainnet",
  "validator": {
    "dashboard_id": 123,
    "group_id": 7
  },
  "range": {
    "timestamp": {
      "start": 1780272000,
      "end": 1782863999
    }
  },
  "page_size": 100
}
'
```

To calculate daily deltas, reuse the Python or JavaScript example above: request `validators/mev-timing` with a `validator` selector in place of the entity request. A page holds up to 100 days, so a 30-day range needs one request.

Keep in mind:

* A day on which none of the validators proposed a block that came from a relay is absent from the series. A small set therefore has gaps; skip the missing dates rather than reading them as zero.
* The selector is evaluated when you call the endpoint. A dashboard, address, or `entities` selector applies its current members to every past day.
* The series ends at the last complete UTC day; the current day is never included.

***

## Profile Your Validator Set

Use the validator aggregate to summarize a validator list, dashboard, dashboard group, withdrawal credential, deposit address, entity, or sub-entity. Currently, the only supported evaluation window is `180d`.

```bash theme={null}
curl --request POST \
  --url https://beaconcha.in/api/v2/ethereum/validators/mev-timing-aggregate \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chain": "mainnet",
  "validator": {
    "dashboard_id": 123,
    "group_id": 7
  },
  "range": {
    "evaluation_window": "180d"
  }
}
'
```

The following shortened response illustrates the comparison workflow. See the [validator timing aggregate reference](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing-aggregate.md).

```json theme={null}
{
  "data": {
    "timing_label": {
      "status": "timing_games",
      "median_slot_offset_ms": 1376,
      "total_count": 284
    },
    "histogram": [
      {
        "slot_offset_ms_min": 1200,
        "slot_offset_ms_max": 1400,
        "count": 31,
        "max_value": "194000000000000000"
      }
    ],
    "evaluation_window": "180d"
  }
}
```

Use the complete distribution to check whether the median reflects a tight cluster or hides a long aggressive tail.

> [!TIP]
>
> Create dashboard groups for infrastructure cohorts such as client, region, node, or relay configuration. Query each `group_id` separately to isolate where a timing shift originates.

***

## Comparison Checklist

> [card] Align UTC Dates
>
> Compare daily rows only when their `date` values match. Do not compare a partial day with a complete day.

> [card] Report Sample Size
>
> Always show `slots_with_relay_winners` or `total_count` next to a median or percentage.

> [card] Inspect the Tail
>
> A healthy median can coexist with aggressive outliers. Review histogram counts beyond 2,600 ms.

> [card] Allow for Reprocessing
>
> Exclude the newest three daily buckets from finalized reports because they may still change.

***

## Related Resources

* [MEV Analysis Introduction](https://docs.beaconcha.in/api/use-cases/mev.md) — Endpoint selection, timing bands, and data freshness
* [Investigate a Block](https://docs.beaconcha.in/api/use-cases/mev/investigate-block.md) — Drill from an aggregate outlier into one proposal
* [MEV Timing Games](https://docs.beaconcha.in/explorer/mev-timing-games.md) — Why operators delay and what the thresholds mean
* [Dashboard as Private Sets](https://docs.beaconcha.in/api/use-cases/rewards/dashboard-private-sets.md) — Organize validators into reusable groups


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.