# Stock watchlist

Prices and day changes for a few stocks, and a short chart on large. A version shows "market closed" outside trading hours.

**Sizes:** small (one stock), medium (two side by side), large (four and a chart)
**Freshness:** your agent every 15 minutes in market hours (stock APIs need keys in headers, so not a job)
**Gotcha:** versions use the phone's time zone. Market hours in New York are different hours on a phone in Riyadh or London.

## Widget

```json
{
  "slug": "stocks",
  "title": "Watchlist",
  "symbol": "chart.line.uptrend.xyaxis",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "metric", "label": "AAPL", "value": "$291.13", "change": "+1.2%" },
    { "type": "metric", "label": "MSFT", "value": "$452.30", "change": "-0.4%" },
    { "type": "metric", "label": "NVDA", "value": "$173.50", "change": "+3.1%" },
    { "type": "metric", "label": "TSLA", "value": "$248.00", "change": "-1.8%" },
    { "type": "chart", "label": "S&P 500, 5 days", "value": "5,752", "change": "+0.8%", "values": [5701, 5688, 5719, 5735, 5752] }
  ],
  "sizes": { "small": [0], "medium": [0, 1], "large": [0, 1, 2, 3, 4] },
  "lock": { "circular": 0, "inline": "AAPL $291 +1.2%" }
}
```

The change's sign colours it, so no per-block `color` is needed. Medium: two prices side by side (57 pt); four would be two rows (124 pt). Large: 57 + 14 + 57 + 14 + 78 = 220 of 296.

## The agentic version

A watchlist is display; the reason to have Droplet.ai is the move. When something the user cares about happens, bring the decision:

```json
{
  "slug": "stocks",
  "title": "Watchlist",
  "symbol": "chart.line.downtrend.xyaxis",
  "accent": "#0A84FF",
  "relevance": 90,
  "blocks": [
    { "type": "metric", "label": "AAPL, -4%", "value": "$279.5" },
    { "type": "text", "text": "AAPL fell 4% after earnings. Sell the 10 shares you flagged? About $2,795." },
    { "type": "buttons", "items": [
      { "id": "sell-aapl-10", "label": "Sell 10", "symbol": "arrow.down.circle" },
      { "id": "hold-aapl", "label": "Hold", "symbol": "hand.raised" }
    ] },
    { "type": "chart", "label": "AAPL today", "change": "-4.0%", "values": [291, 290, 288, 281, 279, 280, 279.5] }
  ],
  "sizes": { "small": [1], "large": [1, 0, 3, 2] },
  "lock": { "circular": 0, "inline": "AAPL -4%: sell 10?" }
}
```

Selling is money: the share count and the rough amount are on the widget, so "Sell 10" is the approval. Place the order with the user's own broker tools (Droplet.ai can't trade), then show "Sold 10 at $279.40" with the next step. If you have no broker connection, say so and offer a link to the broker's https page instead.

## Market closed (a version)

For a user in New York (the phone's local time), outside 09:30 to 16:00 on weekdays, and all weekend. The closed version keeps the same block order, with the last close in it:

```json
{
  "slug": "stocks",
  "title": "Watchlist",
  "symbol": "chart.line.uptrend.xyaxis",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "metric", "label": "AAPL", "value": "$291.13", "change": "+1.2%" },
    { "type": "metric", "label": "MSFT", "value": "$452.30", "change": "-0.4%" },
    { "type": "metric", "label": "NVDA", "value": "$173.50", "change": "+3.1%" },
    { "type": "metric", "label": "TSLA", "value": "$248.00", "change": "-1.8%" },
    { "type": "chart", "label": "S&P 500, 5 days", "value": "5,752", "change": "+0.8%", "values": [5701, 5688, 5719, 5735, 5752] }
  ],
  "variants": [
    { "when": { "days": ["sat", "sun"] }, "subtitle": "Market closed",
      "blocks": [
        { "type": "metric", "label": "AAPL close", "value": "$291.13", "change": "+1.2%" },
        { "type": "metric", "label": "MSFT close", "value": "$452.30", "change": "-0.4%" },
        { "type": "metric", "label": "NVDA close", "value": "$173.50", "change": "+3.1%" },
        { "type": "metric", "label": "TSLA close", "value": "$248.00", "change": "-1.8%" },
        { "type": "text", "style": "caption", "text": "Market closed. Opens Monday 09:30 New York time." }
      ] },
    { "when": { "from": "16:00", "to": "09:30" }, "subtitle": "Market closed",
      "blocks": [
        { "type": "metric", "label": "AAPL close", "value": "$291.13", "change": "+1.2%" },
        { "type": "metric", "label": "MSFT close", "value": "$452.30", "change": "-0.4%" },
        { "type": "metric", "label": "NVDA close", "value": "$173.50", "change": "+3.1%" },
        { "type": "metric", "label": "TSLA close", "value": "$248.00", "change": "-1.8%" },
        { "type": "text", "style": "caption", "text": "Market closed. Opens 09:30 New York time." }
      ] }
  ],
  "sizes": { "small": [0], "medium": [0, 1], "large": [0, 1, 2, 3, 4] },
  "lock": { "circular": 0, "inline": "AAPL $291 +1.2%" }
}
```

The weekend version comes first so it wins all weekend. Refresh the closing prices once after 16:00. For a user in another time zone, convert 09:30 and 16:00 New York time to their local time before you write `from` and `to`.
