Portfolio risk breakdown
get_etf_portfolio_riskUse this when the user gives a portfolio of US ETFs and asks where its risk comes from or how its ETFs move together. Returns the portfolio's volatility, each position's share of the risk and of the capital, the diversification ratio, independent bets, the beta to the S&P 500, and the correlation and covariance of weekly returns over up to three years. It measures diversification by how the ETFs move together, not by companies held. Every ETF needs a year of weekly prices, which most ETFs read from SEC filings do not have here. Uncovered tickers are named and skipped. A trust or pool (bitcoin, gold), a bond, multi-asset or leveraged, inverse or other derivative-based ETF counts from its own weekly prices when it has them, named in read_from_prices. Past, not a forecast. Not for the companies held (get_etf_portfolio_lookthrough).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| currency | No | The currency of the amounts, for example USD or EUR. Echoed back with the values; nothing is converted. Left out, the amounts still weigh the ETFs and the currency reads unstated. | |
| positions | Yes | The ETFs of the portfolio, 1 to 60, for example [{"ticker": "VOO", "amount": 40000}, {"ticker": "QQQ", "amount": 25000}] with "currency": "USD" beside it. Give an amount for every position or for none; with none, every ETF counts equally. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | ||
| covered | No | ||
| skipped | No | ||
| computed | No | ||
| currency | No | ||
| positions | No | ||
| weeks_used | No | ||
| correlation | No | Weekly returns; rows in the order of labels. | |
| not_covered | No | ||
| prices_as_of | No | ||
| holdings_as_of | No | ||
| volatility_pct | No | Annualised. | |
| holdings_source | No | ||
| beta_vs_sp500_1y | No | ||
| beta_vs_sp500_3y | No | ||
| independent_bets | No | ||
| read_from_prices | No | ||
| diversification_ratio | No |