# ETF market data

External component: ETF NAV banner and two fact columns. Figures come live from the market feeds; labels and which fields to show come from `data`. The disclosure is `additionalCopy`.

## Fields & Schema

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `externalComponentType` | Symbol | Yes | Must be `"ETF market data"` |
| `heading` | Text | No | Section h2, used when `data.etfDetailsHeading` is absent. |
| `additionalCopy` | RichText | No | Disclosure shown under the columns. Ignored if empty. |
| `data.etfDetailsHeading` | string | No | Section h2; overrides `heading`. |
| `data.heroFacts` | array | No | Only the first item is used: `{ "source", "field", "label", "format" }`. Its value is the large NAV figure; `label` captions it (default `NAV`). |
| `data.asOfPrefix` | string | No | Default `as of`. The trade date comes from the feed. |
| `data.navChange` | object | No | `{ "amountField", "percentField" }`. Default `navChange` and `percentageChange`. |
| `data.navChangeLabel` | string | No | Caption under the change figures. |
| `data.fundTitle` | string | No | Left column title. |
| `data.facts` | array | No | Left column static rows: `[[label, value], ...]`. |
| `data.holdingsFacts` | array | No | Live rows (see below) added to the left column after the "Benchmark Index" row, or at the end if there is none. |
| `data.detailsHeading` | string | No | Right column title. |
| `data.marketRows` | array | No | Live rows for the right column. |
| `data.expenses` | array | No | Static `[[label, value], ...]` rows appended to the right column. |

A **live row** is `{ "source", "field", "label", "format" }`; all four are required or the row is dropped. `source` is `ice` or `navChange`; any other value reads the daily bag. `format` is one of `nav`, `signedPercent`, `marketPrice`, `signedPercent4`, `shares`, `assets`; any other value prints an em dash. Missing feed values also print an em dash. If the feeds fail, "Market figures are temporarily unavailable." shows.

## Usage

```bash
# Add the component
cms-edit add "ETF market data" --content-type externalComponent --target content

# Set live rows and labels
cms-edit set @ref data --json '{"etfDetailsHeading":"ETF details","heroFacts":[{"source":"ice","field":"nav","label":"NAV","format":"nav"}],"navChangeLabel":"NAV change","fundTitle":"Fund facts","facts":[["Benchmark Index","S&P 500"]],"detailsHeading":"Market details","marketRows":[{"source":"ice","field":"marketPrice","label":"Market price","format":"marketPrice"}],"expenses":[["Gross expense ratio","0.00%"]]}'

# Set the disclosure
cms-edit set @ref additionalCopy "Disclosure text"

cms-edit save
```

`set data --json` replaces the whole object. Read the current `data` first and change only the key you mean to.
