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

# Worked Examples

> Step-by-step index calculations for different scenarios – active markets, resolved markets, staleness, and performance tracking.

These examples walk through actual index calculations using the `midprice-v1` methodology. Each example uses realistic numbers and can be replicated with a spreadsheet and public market data from Polymarket.

> [!NOTE]
>
> Every number below is computed using 8-decimal-place precision with round-half-up, matching the production system exactly. If you follow along in a spreadsheet, your results should match within rounding tolerance.

***

## Example 1: Equal-Weighted Index with 5 Active Markets

A macro-themed series tracking 5 economic prediction markets, all actively trading with two-sided order books.

**Series Composition:**

| # | Market | Best Bid | Best Ask | Midprice | Raw Weight |
| - | - | - | - | - | - |
| 1 | Fed cuts by June | 0.82 | 0.83 | 0.8250 | 0.20 |
| 2 | CPI below 3% by Q2 | 0.71 | 0.72 | 0.7150 | 0.20 |
| 3 | Unemployment above 4.5% | 0.35 | 0.37 | 0.3600 | 0.20 |
| 4 | 10Y yield below 4% | 0.44 | 0.46 | 0.4500 | 0.20 |
| 5 | GDP growth above 2% | 0.58 | 0.59 | 0.5850 | 0.20 |

**1. Compute midprices**

For each market, average the best bid and best ask:

```
Market 1: (0.82 + 0.83) / 2 = 0.82500000
Market 2: (0.71 + 0.72) / 2 = 0.71500000
Market 3: (0.35 + 0.37) / 2 = 0.36000000
Market 4: (0.44 + 0.46) / 2 = 0.45000000
Market 5: (0.58 + 0.59) / 2 = 0.58500000
```

Each midprice represents the market's implied probability for that event occurring.

**2. Normalize weights**

```
Sum of raw weights = 5 x 0.20 = 1.00
```

Since the raw weights already sum to 1.00, normalized weights equal the raw weights:

```
w'_1 = w'_2 = w'_3 = w'_4 = w'_5 = 0.20000000
```

**3. Compute the raw index value**

Multiply each normalized weight by its market's midprice and sum:

```
raw_nav = (0.20 x 0.82500000)
        + (0.20 x 0.71500000)
        + (0.20 x 0.36000000)
        + (0.20 x 0.45000000)
        + (0.20 x 0.58500000)

        = 0.16500000
        + 0.14300000
        + 0.07200000
        + 0.09000000
        + 0.11700000

        = 0.58700000
```

**4. Compute Index Level**

Assume the series launched with an inception raw index value of 0.55000000:

```
index_level = 100 x (0.58700000 / 0.55000000)
            = 100 x 1.06727273
            = 106.72727273
```

The index has gained approximately 6.7% from inception.

**Interpretation:** The weighted-average implied probability across all 5 markets is about 58.7%. The highest-confidence market is "Fed cuts by June" at 82.5%, while the lowest is "Unemployment above 4.5%" at 36%. The index is up \~6.7% from inception, meaning the aggregate probability of these events has increased since the series launched.

> [!TIP]
>
> The markets in this example are illustrative, so live prices will differ. To verify a real published value, pick a live series, fetch the current best bid and best ask for each of its constituents, and follow the [Independent Verification Guide](/docs/indices/nav-methodology.md#independent-verification-guide) – your result should match the published raw index value within the tolerances documented there.

***

## Example 2: Index with Resolved Markets

A 4-market series where two markets have already settled – one won, one lost.

**Series Composition:**

| # | Market | Status | Tracked Outcome | Price Source | Price Used | Raw Weight |
| - | - | - | - | - | - | - |
| 1 | Fed cuts in January | Resolved | YES (Won) | Settlement | 1.00 | 0.25 |
| 2 | CPI below 2% in Q1 | Resolved | YES (Lost) | Settlement | 0.00 | 0.25 |
| 3 | Recession by mid-year | Active | YES | Midprice | 0.18 | 0.25 |
| 4 | Core PCE below 2.5% | Active | YES | Midprice | 0.62 | 0.25 |

**1. Apply resolution prices**

* Market 1: The tracked outcome (YES) **won** – settlement price = **\$1.00**
* Market 2: The tracked outcome (YES) **lost** – settlement price = **\$0.00**
* Markets 3 and 4 remain active and use live midprices from the order book

**2. Normalize weights**

All four markets participate in the computation regardless of resolution status.

```
Sum of raw weights = 4 x 0.25 = 1.00
Normalized weight = 0.25 for each market
```

**3. Compute the raw index value**

```
raw_nav = (0.25 x 1.00)     Market 1: resolved winner
        + (0.25 x 0.00)     Market 2: resolved loser
        + (0.25 x 0.18)     Market 3: active
        + (0.25 x 0.62)     Market 4: active

        = 0.25000000
        + 0.00000000
        + 0.04500000
        + 0.15500000

        = 0.45000000
```

**4. Interpret the result**

The raw index value of 0.45 reflects the mix of settled outcomes and remaining active markets:

* The winning market (#1) contributes its full weight (0.25) to the index value
* The losing market (#2) contributes nothing (0.00)
* The two active markets contribute based on their current implied probabilities

> [!NOTE]
>
> In a Fixed series, resolved markets remain in the index with their settlement prices until the terminal value. They are not removed. This means a losing market at \$0.00 permanently drags the index down by its weighted share, while a winning market at \$1.00 permanently supports it. This is by design – the index tracks the full history of outcomes.
>
> In a Perpetual series, from 2026-09-30, resolved markets hold their settlement prices only until the next scheduled review. At that review, if no markets are added, Markets 1 and 2 leave the composition, and the remaining weights are scaled up in proportion: 0.25 / (1 − 0.50) = 0.50 each. The new composition's raw index value is 0.50 x 0.18 + 0.50 x 0.62 = 0.40, and the series is [chain-linked](/docs/indices/nav-methodology.md#step-5-chain-linking-perpetual-series) across the change, so the published level does not jump. The outcomes already realized stay in the level; from the review onward, the level moves only with the remaining active markets.

**What if both resolved markets had won?**

```
raw_nav = (0.25 x 1.00) + (0.25 x 1.00) + (0.25 x 0.18) + (0.25 x 0.62)
        = 0.25 + 0.25 + 0.045 + 0.155
        = 0.70
```

The index value would be 0.70 instead of 0.45 – a significant difference driven entirely by the resolution outcomes.

***

## Example 3: Staleness – Missing Price Data

What happens when the system cannot fetch a current price for one of the underlying markets.

**Scenario:** A 4-market series where Market #3's price fetch fails after three retries.

| # | Market | Current Price | Previous Price | Status |
| - | - | - | - | - |
| 1 | Market A | 0.72 (live) | 0.70 | Fresh |
| 2 | Market B | 0.55 (live) | 0.53 | Fresh |
| 3 | Market C | *fetch failed* | 0.41 | **Stale** (using fallback) |
| 4 | Market D | 0.88 (live) | 0.87 | Fresh |

All markets have equal weight (0.25 each).

**1. Apply fallback for Market #3**

The system attempted to fetch Market C's order book three times with exponential backoff. All attempts failed (e.g., API timeout or network error).

**Fallback rule:** Use the last successfully fetched price. Market C's previous midprice was **0.41**, so that value is used.

**2. Compute the raw index value**

```
raw_nav = (0.25 x 0.72)   Market A: fresh
        + (0.25 x 0.55)   Market B: fresh
        + (0.25 x 0.41)   Market C: stale (fallback)
        + (0.25 x 0.88)   Market D: fresh

        = 0.18000000
        + 0.13750000
        + 0.10250000
        + 0.22000000

        = 0.64000000
```

**3. Flag the computation as stale**

Because Market C used a fallback price, the **entire computation** is marked as stale. This flag is visible in the published data.

If Market C's actual price had moved (say, from 0.41 to 0.48), the true index value would be:

```
true_raw_nav = (0.25 x 0.72) + (0.25 x 0.55) + (0.25 x 0.48) + (0.25 x 0.88)
             = 0.65750000
```

The difference (0.6575 vs 0.6400) is 0.0175, or about 2.7% – entirely attributable to the stale data.

> [!WARNING]
>
> A stale index value should be interpreted with caution. The published value may be higher or lower than reality, depending on how the affected market's price has moved since the last successful fetch. Once the price feed recovers, subsequent computations will use fresh data and the staleness flag will clear.

**When does staleness trigger?**

| Condition | Result |
| - | - |
| API timeout or network failure | Stale – uses last known price |
| One-sided order book (only bids, no asks) | Stale – midprice cannot be computed |
| Market data unavailable for all markets | Computation fails entirely |
| Market is resolved | Never stale – settlement prices are definitive |

***

## Example 4: Tracking Index Level Over Time

How the Index Level tracks performance from inception to present, and how it relates to the raw index value.

**Scenario:** A series launches with an inception raw index value of 0.4200. Over six weeks, market prices shift:

| Date | Raw index value | Index Level Calculation | Index Level | Change |
| - | - | - | - | - |
| Week 0 (inception) | 0.42000000 | 100 x (0.4200 / 0.4200) | 100.00 | – |
| Week 1 | 0.43500000 | 100 x (0.4350 / 0.4200) | 103.57 | +3.57% |
| Week 2 | 0.39800000 | 100 x (0.3980 / 0.4200) | 94.76 | -5.24% |
| Week 3 | 0.41000000 | 100 x (0.4100 / 0.4200) | 97.62 | -2.38% |
| Week 4 | 0.45000000 | 100 x (0.4500 / 0.4200) | 107.14 | +7.14% |
| Week 5 | 0.44200000 | 100 x (0.4420 / 0.4200) | 105.24 | +5.24% |
| Week 6 | 0.47600000 | 100 x (0.4760 / 0.4200) | 113.33 | +13.33% |

**1. Index Level at inception**

At launch, the Index Level is always 100.00 – this is the base value.

```
index_level = 100 x (0.42000000 / 0.42000000) = 100.00000000
```

**2. Index Level after a gain (Week 1)**

The raw index value increased from 0.4200 to 0.4350 (underlying probabilities rose):

```
index_level = 100 x (0.43500000 / 0.42000000)
            = 100 x 1.03571429
            = 103.57142857
```

The index is up 3.57% from inception.

**3. Index Level after a decline (Week 2)**

The raw index value dropped to 0.3980 (some underlying probabilities fell):

```
index_level = 100 x (0.39800000 / 0.42000000)
            = 100 x 0.94761905
            = 94.76190476
```

The index is down 5.24% from inception. Note: the drawdown from Week 1 to Week 2 is even larger – from 103.57 to 94.76, a decline of 8.5% week-over-week.

**4. Full recovery and beyond (Week 6)**

By Week 6, the raw index value has risen to 0.4760:

```
index_level = 100 x (0.47600000 / 0.42000000)
            = 100 x 1.13333333
            = 113.33333333
```

The index is up 13.33% from inception. Over that span the index swung from 94.76 (Week 2 low) to 113.33 (Week 6).

**Key properties of the Index Level:**

| Property | Explanation |
| - | - |
| Always starts at 100 | The base value is set at inception |
| Proportional to the raw index value | A 10% increase in the raw index value = a 10% increase in Index Level |
| Inception value is fixed | The denominator never changes – it is locked at the first computation |
| Cannot go below 0 | Because the raw index value is bounded between 0 and 1, and inception is positive |
| Cannot exceed \~238 | Because the raw index value maxes out at 1.0 (in the inception\_raw\_nav = 0.42 example above) |

> [!NOTE]
>
> The Index Level tracks *theoretical* index performance, gross of costs. It is a measurement of a basket, not a return anyone realized: no fund, product, or account tracks these indices.

***

## Formula Reference

For quick reference, all formulas used in these examples:

| Formula | Expression |
| - | - |
| **Midprice** | `(best_bid + best_ask) / 2` |
| **Weight normalization** | `w'_i = w_i / sum(w)` |
| **Raw index value** | `sum(w'_i x price_i)` for all markets |
| **Index Level** | `100 x (raw_nav / inception_raw_nav)` |

> [card] [Index Calculation Methodology](/docs/indices/nav-methodology.md)
>
> Full methodology specification with verification guide.

> [card] [Perpetual Series](/docs/indices/perpetual-series.md)
>
> Reconstitution, chain-linking, and review cadence.


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