# End-of-Day (EOD) Report

A comprehensive daily portfolio summary delivered as an HTML report.
The EOD report is one of the headline use cases for InvestorClaw — it
consolidates every section of the deterministic envelope (holdings,
performance, bonds, analyst, news, cashflow, synthesis) into a single
artifact suitable for archiving, advisor handoff, or follow-up
analysis.

## What's in the report

A typical EOD report covers:

| Section | Content |
|---|---|
| **Header** | Portfolio total value, day-over-day delta, freshness timestamp |
| **Holdings snapshot** | Top positions by weight, sector / asset-class breakdown, account-level allocation |
| **Performance** | Day / week / month / YTD / 1Y returns, Sharpe + Sortino, max drawdown, beta |
| **Bond analytics** | Yield-to-maturity, duration, coupon calendar, FRED yield-curve overlay |
| **Analyst consensus** | Aggregated buy / hold / sell ratings, price-target spread per holding |
| **News** | Per-symbol headlines + general / forex / crypto / merger feeds (last 24 h) |
| **Cashflow projections** | Upcoming dividends + bond coupons + maturities |
| **Synthesis** | Multi-factor narrative tying the above together |
| **Disclaimer** | Educational-only framing; not investment advice |

The report is HTML — render-ready in any browser, email-ready via
SMTP, archivable as a static file. The deterministic envelope behind
it is HMAC-signed, so the numbers are reproducible and audit-friendly.

## How to generate one

Ask your agent in natural language:

```text
Generate today's EOD report.
```

Your agent routes through `portfolio_ask`, which the engine recognizes
as an EOD intent and dispatches to the report generator. The HTML
artifact lands in `./reports/YYYY-MM-DD/eod_report_YYYY-MM-DD.html` on
the host (the bind-mounted reports directory).

You can also drive it directly via REST for scripting:

```bash
curl -sS -X POST http://localhost:18090/api/portfolio/ask \
  -H 'Content-Type: application/json' \
  -d '{"question": "Generate today end-of-day report."}' \
  --max-time 240
```

The response includes the path to the saved HTML report and a brief
narrative summary of the highlights.

## Performance

| Portfolio size | Cold-cache | Warm-cache |
|---|---|---|
| 25 positions | 8–15 s | <2 s |
| 100 positions | 15–25 s | <3 s |
| 200+ positions | 25–60 s | <5 s |

Times are dominated by the deterministic refresh pass (yfinance free-
tier or your configured paid providers). The HTML render itself is
sub-second.

## Variations

### Stonkmode EOD

If stonkmode is enabled, the EOD report's narrative section is
generated by a randomly-paired duo of fictional cable-finance TV
personalities. Same numbers, entertaining framing. See
[`STONKMODE.md`](../STONKMODE.md).

### Email delivery (optional)

For automated daily delivery, set up a cron job on the host that calls
the engine and pipes the HTML report to your local SMTP:

```bash
# crontab -e
0 17 * * 1-5 curl -sS -X POST http://localhost:18090/api/portfolio/ask \
  -H 'Content-Type: application/json' \
  -d '{"question":"Generate today end-of-day report"}' \
  >/dev/null && \
  /usr/bin/mailx -a "$HOME/.investorclaw/reports/$(date +%F)/eod_report_$(date +%F).html" \
                 -s "InvestorClaw EOD $(date +%F)" \
                 you@example.com < /dev/null
```

Replace `mailx` with your local mail tool. The maintainer doesn't run
an email service.

### Archiving

Reports persist in `./reports/YYYY-MM-DD/` indefinitely. Rotate via
your own cron / find-based cleanup; InvestorClaw doesn't auto-prune.

## Output contract

The HTML artifact contains:

- Every section listed above as collapsible cards
- Inline CSS (no external requests for offline portability)
- The HMAC signature of the deterministic envelope as a footer
  fingerprint (lets you verify report authenticity later)
- The educational-only disclaimer banner at the top and bottom

For the JSON envelope schema underlying the report, see
[`docs/references/contract-output.md`](references/contract-output.md).

## What the EOD report is NOT

- Not a trade recommendation — no buy/sell signals are generated
- Not real-time — it's a snapshot at the time of generation; for live
  data, use `portfolio_refresh` then re-ask
- Not a replacement for your custodian's official statement — those
  are the legal record of your holdings; this is an analytical view
- Not investment advice — see [`DISCLAIMER.md`](../DISCLAIMER.md)

## See also

- [`SKILL.md § Run Analysis`](../SKILL.md) — how the agent dispatches
  EOD intents through `portfolio_ask`
- [`CAPABILITIES.md`](../CAPABILITIES.md) — full feature catalog
- [`STONKMODE.md`](../STONKMODE.md) — narrated commentary mode (works
  with EOD)
- [`docs/references/contract-output.md`](references/contract-output.md)
  — output spec
