# Crypto dashboard

Bitcoin and Ether prices with the 24-hour change, kept current by a cloud job.

**Sizes:** small (BTC), medium (BTC and ETH side by side), large (prices and a 7-day chart)
**Freshness:** a job every 15 minutes (prices); your agent for the chart, if you want one

## Widget (a snapshot)

```json
{
  "slug": "crypto",
  "title": "Crypto",
  "symbol": "bitcoinsign.circle.fill",
  "accent": "#F7931A",
  "blocks": [
    { "type": "metric", "label": "BTC", "value": "$67.2k", "change": "+2.1%" },
    { "type": "metric", "label": "ETH", "value": "$2,540", "change": "+1.4%", "color": "#8C8CFF" },
    { "type": "chart", "label": "BTC 7 days", "value": "$67.2k", "change": "+2.1%", "style": "area",
      "values": [65000, 65400, 66100, 65800, 67500, 68200, 67200] }
  ],
  "sizes": { "small": [0], "medium": [0, 1], "large": [0, 1, 2] },
  "lock": { "circular": 0, "inline": "BTC $67.2k +2.1%" }
}
```

Medium: two prices with change lines side by side (57 pt). Adding the chart there would need 57 + 10 + 78 = 145 pt; medium has 100. Large: 57 + 14 + 78 = 149 of 296.

## The job (CoinGecko, no key needed)

```json
{
  "action": "schedule",
  "name": "crypto-prices",
  "widget_slug": "crypto",
  "every_minutes": 15,
  "fetch": { "url": "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum&vs_currencies=usd&include_24hr_change=true&include_market_cap=true" },
  "values": {
    "btc": "bitcoin.usd",
    "btc_change": "bitcoin.usd_24h_change",
    "btc_cap": "bitcoin.usd_market_cap",
    "eth": "ethereum.usd",
    "eth_change": "ethereum.usd_24h_change",
    "eth_cap": "ethereum.usd_market_cap"
  },
  "widget": {
    "title": "Crypto",
    "subtitle": "{{now|time}}",
    "symbol": "bitcoinsign.circle.fill",
    "accent": "#F7931A",
    "blocks": [
      { "type": "metric", "label": "BTC", "value": "{{btc|money}}", "change": "{{btc_change|percent}}" },
      { "type": "metric", "label": "ETH", "value": "{{eth|money}}", "change": "{{eth_change|percent}}", "color": "#8C8CFF" },
      { "type": "list", "items": ["BTC market cap {{btc_cap|money}}", "ETH market cap {{eth_cap|money}}", "Updated {{now|time}}"] }
    ],
    "sizes": { "small": [0], "medium": [0, 1], "large": [0, 1, 2] },
    "lock": { "circular": 0 }
  }
}
```

- `money` adds the `$` itself and drops decimals at 100 and above: `"$80,702"`. Don't put a `$` in front.
- `percent` adds the sign and `%`: `"+0.7%"`, so the change is green or red by itself.
- There's no compact filter (`$67.2k`). Above $99,999 the value reaches 8 characters, the most a metric shows comfortably; check the first run's `check`.
- The job owns this widget's blocks: each run replaces them with the template, so the chart from the snapshot is gone after the first run. The list of market caps keeps large more than half full. Keep a chart in a widget your agent writes, or leave it out.
- The agentic move a job can't make: "BTC crossed your $80k alert. Take the profit you planned?" needs your agent to watch the price and put that decision on the widget.
- Test without saving: the same body with `"action": "test_job"`.
