Portfolio risk analytics — VaR, Monte Carlo, optimization, options Greeks, stress testing.
Call this server's tools from your browser. Nothing to install.
Requests go through mcptry because browsers can't call most MCP servers directly. Header values are sent to the server for that request only and are never stored or logged.
Tool list from our last check. Connect live to refresh it.
Calculate core risk metrics for a portfolio — Value at Risk (VaR), Conditional VaR (CVaR), volatility, beta, and max drawdown.
Array of portfolio positions. Each entry needs a ticker and quantity. Free tier: max 20 positions. Paid tier: up to 500.
VaR calculation method. "historical" uses empirical return distribution, "parametric" assumes normality, "cornish_fisher" adjusts for skew and kurtosis. Default: "historical".
Benchmark ticker for beta calculation, e.g. SPY or QQQ. Default: SPY.
Risk horizon in trading days. 1 = overnight, 21 ≈ 1 month, 252 ≈ 1 year. Default: 1.
Number of historical trading days to use. 252 ≈ 1 year, 756 ≈ 3 years. Range: 30-1260. Default: 252.
VaR confidence level as a decimal, e.g. 0.95 = 95%. Range: 0.01-0.99. Default: 0.95.
This tool isn't marked read-only, so it may change something on the server or in an account you connected.
Calculate core risk metrics for a portfolio — Value at Risk (VaR), Conditional VaR (CVaR), volatility, beta, and max drawdown.
| Argument | Type | Description |
|---|---|---|
| method | string | VaR calculation method. "historical" uses empirical return distribution, "parametric" assumes normality, "cornish_fisher" adjusts for skew and kurtosis. Default: "historical". |
| benchmark | string | Benchmark ticker for beta calculation, e.g. SPY or QQQ. Default: SPY. |
| positions* | array | Array of portfolio positions. Each entry needs a ticker and quantity. Free tier: max 20 positions. Paid tier: up to 500. |
| horizon_days | integer | Risk horizon in trading days. 1 = overnight, 21 ≈ 1 month, 252 ≈ 1 year. Default: 1. |
| lookback_days | integer | Number of historical trading days to use. 252 ≈ 1 year, 756 ≈ 3 years. Range: 30-1260. Default: 252. |
| confidence_level | number | VaR confidence level as a decimal, e.g. 0.95 = 95%. Range: 0.01-0.99. Default: 0.95. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"positions"
],
"properties": {
"method": {
"enum": [
"historical",
"parametric",
"cornish_fisher"
],
"type": "string",
"default": "historical",
"description": "VaR calculation method. \"historical\" uses empirical return distribution, \"parametric\" assumes normality, \"cornish_fisher\" adjusts for skew and kurtosis. Default: \"historical\"."
},
"benchmark": {
"type": "string",
"default": "SPY",
"maxLength": 10,
"minLength": 1,
"description": "Benchmark ticker for beta calculation, e.g. SPY or QQQ. Default: SPY."
},
"positions": {
"type": "array",
"items": {
"type": "object",
"required": [
"ticker",
"quantity"
],
"properties": {
"ticker": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol, e.g. AAPL or MSFT. Must be uppercase, 1-10 characters."
},
"quantity": {
"type": "number",
"description": "Number of shares held. Use a negative value to represent a short position."
},
"cost_basis": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Per-share cost basis in USD. Optional — used only for P&L calculations."
}
},
"additionalProperties": false
},
"maxItems": 500,
"minItems": 1,
"description": "Array of portfolio positions. Each entry needs a ticker and quantity. Free tier: max 20 positions. Paid tier: up to 500."
},
"horizon_days": {
"type": "integer",
"default": 1,
"maximum": 252,
"minimum": 1,
"description": "Risk horizon in trading days. 1 = overnight, 21 ≈ 1 month, 252 ≈ 1 year. Default: 1."
},
"lookback_days": {
"type": "integer",
"default": 252,
"maximum": 1260,
"minimum": 30,
"description": "Number of historical trading days to use. 252 ≈ 1 year, 756 ≈ 3 years. Range: 30-1260. Default: 252."
},
"confidence_level": {
"type": "number",
"default": 0.95,
"maximum": 0.99,
"minimum": 0.01,
"description": "VaR confidence level as a decimal, e.g. 0.95 = 95%. Range: 0.01-0.99. Default: 0.95."
}
},
"additionalProperties": false
}Calculate option Greeks (delta, gamma, theta, vega, rho) for individual options or an options portfolio. Uses Black-Scholes for European, binomial for American style. Paid tier only.
| Argument | Type | Description |
|---|---|---|
| options* | array | Array of option positions to calculate Greeks for. 1-100 options. Results include per-option Greeks and aggregated portfolio Greeks. |
| risk_free_rate | number | Annualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Black-Scholes and binomial pricing models. Default: 0.05. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"options"
],
"properties": {
"options": {
"type": "array",
"items": {
"type": "object",
"required": [
"underlying",
"strike",
"expiry",
"option_type"
],
"properties": {
"style": {
"enum": [
"european",
"american"
],
"type": "string",
"default": "european",
"description": "Option exercise style. \"european\" can only be exercised at expiry (Black-Scholes). \"american\" can be exercised any time (binomial model). Default: \"european\"."
},
"expiry": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"description": "Option expiry date in ISO 8601 format, e.g. 2026-12-19. Must be a future date."
},
"strike": {
"type": "number",
"description": "Option strike price in USD. Must be a positive number.",
"exclusiveMinimum": 0
},
"quantity": {
"type": "integer",
"default": 1,
"description": "Number of contracts. Positive = long, negative = short. Default: 1."
},
"underlying": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol of the underlying asset, e.g. AAPL."
},
"option_type": {
"enum": [
"call",
"put"
],
"type": "string",
"description": "Option type: \"call\" gives the right to buy, \"put\" gives the right to sell."
},
"market_price": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Current market price of the option in USD. Required when implied_volatility is not provided."
},
"implied_volatility": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Implied volatility as a decimal, e.g. 0.25 = 25%. If omitted or null, it is computed from market_price."
}
},
"additionalProperties": false
},
"maxItems": 100,
"minItems": 1,
"description": "Array of option positions to calculate Greeks for. 1-100 options. Results include per-option Greeks and aggregated portfolio Greeks."
},
"risk_free_rate": {
"type": "number",
"default": 0.05,
"maximum": 1,
"minimum": 0,
"description": "Annualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Black-Scholes and binomial pricing models. Default: 0.05."
}
},
"additionalProperties": false
}Compare two or more portfolio allocations head-to-head across all key risk and return metrics. Paid tier only.
| Argument | Type | Description |
|---|---|---|
| portfolios* | array | Two to five named portfolios to compare head-to-head. Each needs a unique name and a list of positions. Min: 2, max: 5. |
| period_days | integer | Lookback period in trading days used for return and risk calculations. 252 = ~1 year. Range: 30-1260. Default: 252. |
| confidence_level | number | VaR confidence level as a decimal, e.g. 0.95 = 95%. Range: 0.01-0.99. Default: 0.95. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"portfolios"
],
"properties": {
"portfolios": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"positions"
],
"properties": {
"name": {
"type": "string",
"maxLength": 50,
"minLength": 1,
"description": "Human-readable label for this portfolio, e.g. 'Current' or 'Rebalanced'. 1-50 chars."
},
"positions": {
"type": "array",
"items": {
"type": "object",
"required": [
"ticker",
"quantity"
],
"properties": {
"ticker": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol, e.g. AAPL or MSFT. Must be uppercase, 1-10 characters."
},
"quantity": {
"type": "number",
"description": "Number of shares held. Use a negative value to represent a short position."
},
"cost_basis": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Per-share cost basis in USD. Optional — used only for P&L calculations."
}
},
"additionalProperties": false
},
"maxItems": 500,
"minItems": 1,
"description": "Positions in this portfolio. 1-500 entries."
}
},
"additionalProperties": false
},
"maxItems": 5,
"minItems": 2,
"description": "Two to five named portfolios to compare head-to-head. Each needs a unique name and a list of positions. Min: 2, max: 5."
},
"period_days": {
"type": "integer",
"default": 252,
"maximum": 1260,
"minimum": 30,
"description": "Lookback period in trading days used for return and risk calculations. 252 = ~1 year. Range: 30-1260. Default: 252."
},
"confidence_level": {
"type": "number",
"default": 0.95,
"maximum": 0.99,
"minimum": 0.01,
"description": "VaR confidence level as a decimal, e.g. 0.95 = 95%. Range: 0.01-0.99. Default: 0.95."
}
},
"additionalProperties": false
}Compute the pairwise correlation matrix for a set of assets. Identifies highly correlated pairs and diversification opportunities.
| Argument | Type | Description |
|---|---|---|
| method | string | Correlation method. "pearson" = linear correlation (standard), "spearman" = rank-based (robust to outliers), "kendall" = concordance-based. Default: "pearson". |
| tickers* | array | Tickers to include in the correlation matrix. Minimum 2, maximum 50. Free tier: max 10 tickers. Paid tier: up to 50. |
| lookback_days | integer | Historical window for computing correlations in trading days. 30 = ~6 weeks, 252 = ~1 year. Range: 30-1260. Default: 252. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"tickers"
],
"properties": {
"method": {
"enum": [
"pearson",
"spearman",
"kendall"
],
"type": "string",
"default": "pearson",
"description": "Correlation method. \"pearson\" = linear correlation (standard), \"spearman\" = rank-based (robust to outliers), \"kendall\" = concordance-based. Default: \"pearson\"."
},
"tickers": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1
},
"maxItems": 50,
"minItems": 2,
"description": "Tickers to include in the correlation matrix. Minimum 2, maximum 50. Free tier: max 10 tickers. Paid tier: up to 50."
},
"lookback_days": {
"type": "integer",
"default": 252,
"maximum": 1260,
"minimum": 30,
"description": "Historical window for computing correlations in trading days. 30 = ~6 weeks, 252 = ~1 year. Range: 30-1260. Default: 252."
}
},
"additionalProperties": false
}Run Monte Carlo simulation on a portfolio to model the distribution of future returns, including percentile outcomes and probability of loss.
| Argument | Type | Description |
|---|---|---|
| seed | any | Random seed for reproducible results. Omit for a fresh random run each time. |
| model | string | Stochastic process model. "gbm" = Geometric Brownian Motion (standard), "jump_diffusion" = adds jump risk for fat-tail scenarios. Default: "gbm". |
| num_paths | integer | Number of simulation paths to run. More paths = more accurate but slower. Free tier: max 1,000. Paid tier: up to 100,000. Default: 10,000. |
| positions* | array | Array of portfolio positions. Free tier: max 20 positions. Paid tier: up to 500. |
| horizon_days | integer | Simulation horizon in trading days. 21 ≈ 1 month, 63 ≈ 1 quarter, 252 ≈ 1 year. Default: 21. |
| lookback_days | integer | Historical window used to estimate drift and volatility parameters. Range: 30-1260 trading days. Default: 252. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"positions"
],
"properties": {
"seed": {
"anyOf": [
{
"type": "integer",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Random seed for reproducible results. Omit for a fresh random run each time."
},
"model": {
"enum": [
"gbm",
"jump_diffusion"
],
"type": "string",
"default": "gbm",
"description": "Stochastic process model. \"gbm\" = Geometric Brownian Motion (standard), \"jump_diffusion\" = adds jump risk for fat-tail scenarios. Default: \"gbm\"."
},
"num_paths": {
"type": "integer",
"default": 10000,
"maximum": 100000,
"minimum": 100,
"description": "Number of simulation paths to run. More paths = more accurate but slower. Free tier: max 1,000. Paid tier: up to 100,000. Default: 10,000."
},
"positions": {
"type": "array",
"items": {
"type": "object",
"required": [
"ticker",
"quantity"
],
"properties": {
"ticker": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol, e.g. AAPL or MSFT. Must be uppercase, 1-10 characters."
},
"quantity": {
"type": "number",
"description": "Number of shares held. Use a negative value to represent a short position."
},
"cost_basis": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Per-share cost basis in USD. Optional — used only for P&L calculations."
}
},
"additionalProperties": false
},
"maxItems": 500,
"minItems": 1,
"description": "Array of portfolio positions. Free tier: max 20 positions. Paid tier: up to 500."
},
"horizon_days": {
"type": "integer",
"default": 21,
"maximum": 252,
"minimum": 1,
"description": "Simulation horizon in trading days. 21 ≈ 1 month, 63 ≈ 1 quarter, 252 ≈ 1 year. Default: 21."
},
"lookback_days": {
"type": "integer",
"default": 252,
"maximum": 1260,
"minimum": 30,
"description": "Historical window used to estimate drift and volatility parameters. Range: 30-1260 trading days. Default: 252."
}
},
"additionalProperties": false
}Find the optimal portfolio allocation using mean-variance optimization. Supports max Sharpe, min variance, and target return objectives. Paid tier only.
| Argument | Type | Description |
|---|---|---|
| tickers* | array | Universe of tickers to optimize across. Must be 2-50 tickers. The optimizer will determine the best weights within this set. |
| objective | string | Optimization objective. "max_sharpe" = maximize risk-adjusted return, "min_variance" = minimize portfolio volatility, "target_return" = hit a specific return with minimum risk. Default: "max_sharpe". |
| constraints | object | Optional weight constraints. See ConstraintsInput for details. |
| lookback_days | integer | Historical window for estimating return and covariance. 252 = 1 year, 756 = 3 years, 1260 = 5 years. Range: 252-1260. Default: 756. |
| target_return | any | Required when objective is "target_return". Annualized return as a decimal, e.g. 0.12 = 12% annual return target. |
| risk_free_rate | number | Annualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Sharpe ratio calculation. Default: 0.05. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"tickers"
],
"properties": {
"tickers": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1
},
"maxItems": 50,
"minItems": 2,
"description": "Universe of tickers to optimize across. Must be 2-50 tickers. The optimizer will determine the best weights within this set."
},
"objective": {
"enum": [
"max_sharpe",
"min_variance",
"target_return"
],
"type": "string",
"default": "max_sharpe",
"description": "Optimization objective. \"max_sharpe\" = maximize risk-adjusted return, \"min_variance\" = minimize portfolio volatility, \"target_return\" = hit a specific return with minimum risk. Default: \"max_sharpe\"."
},
"constraints": {
"type": "object",
"properties": {
"max_weight": {
"type": "number",
"default": 1,
"maximum": 1,
"minimum": 0,
"description": "Maximum allocation weight per asset as a decimal. 0.1 = max 10% in any single asset. Range: 0.0-1.0. Default: 1.0."
},
"min_weight": {
"type": "number",
"default": 0,
"maximum": 1,
"minimum": 0,
"description": "Minimum allocation weight per asset as a decimal. 0.0 = no minimum (asset may be excluded). Range: 0.0-1.0. Default: 0.0."
},
"sector_max": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "number",
"maximum": 1,
"minimum": 0
}
},
{
"type": "null"
}
],
"description": "Maximum total portfolio weight per sector, e.g. { Technology: 0.30 } = max 30% in tech. Keys should be GICS sector names."
}
},
"description": "Optional weight constraints. See ConstraintsInput for details.",
"additionalProperties": false
},
"lookback_days": {
"type": "integer",
"default": 756,
"maximum": 1260,
"minimum": 252,
"description": "Historical window for estimating return and covariance. 252 = 1 year, 756 = 3 years, 1260 = 5 years. Range: 252-1260. Default: 756."
},
"target_return": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Required when objective is \"target_return\". Annualized return as a decimal, e.g. 0.12 = 12% annual return target."
},
"risk_free_rate": {
"type": "number",
"default": 0.05,
"maximum": 1,
"minimum": 0,
"description": "Annualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Sharpe ratio calculation. Default: 0.05."
}
},
"additionalProperties": false
}Break down portfolio performance into factor exposures, sector allocation, and position contributions. Computes Sharpe, Sortino, Treynor, Calmar, and Information ratios.
| Argument | Type | Description |
|---|---|---|
| benchmark | string | Benchmark ticker for relative performance metrics (Information Ratio, Tracking Error, Beta). Default: SPY. |
| positions* | array | Array of portfolio positions. Free tier: max 20 positions (basic ratios only). Paid tier: up to 500 positions with full factor attribution. |
| period_days | integer | Measurement period in trading days. 252 = ~1 year. Range: 30-1260. Default: 252. |
| risk_free_rate | number | Annualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Sharpe, Sortino, and Treynor ratios. Default: 0.05. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"positions"
],
"properties": {
"benchmark": {
"type": "string",
"default": "SPY",
"maxLength": 10,
"minLength": 1,
"description": "Benchmark ticker for relative performance metrics (Information Ratio, Tracking Error, Beta). Default: SPY."
},
"positions": {
"type": "array",
"items": {
"type": "object",
"required": [
"ticker",
"quantity"
],
"properties": {
"ticker": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol, e.g. AAPL or MSFT. Must be uppercase, 1-10 characters."
},
"quantity": {
"type": "number",
"description": "Number of shares held. Use a negative value to represent a short position."
},
"cost_basis": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Per-share cost basis in USD. Optional — used only for P&L calculations."
}
},
"additionalProperties": false
},
"maxItems": 500,
"minItems": 1,
"description": "Array of portfolio positions. Free tier: max 20 positions (basic ratios only). Paid tier: up to 500 positions with full factor attribution."
},
"period_days": {
"type": "integer",
"default": 252,
"maximum": 1260,
"minimum": 30,
"description": "Measurement period in trading days. 252 = ~1 year. Range: 30-1260. Default: 252."
},
"risk_free_rate": {
"type": "number",
"default": 0.05,
"maximum": 1,
"minimum": 0,
"description": "Annualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Sharpe, Sortino, and Treynor ratios. Default: 0.05."
}
},
"additionalProperties": false
}Fetch historical OHLCV price data for one or more tickers. Free tier: 1 ticker, 252 days. Paid tier: up to 20 tickers, 1260 days.
| Argument | Type | Description |
|---|---|---|
| days | integer | Number of historical trading days to return. Free tier: max 252 days (~1 year). Paid tier: up to 1260 days (~5 years). Default: 252. |
| tickers* | array | Ticker symbols to fetch price history for. Free tier: max 1 ticker. Paid tier: up to 20 tickers. |
| interval | string | Price interval. "daily" returns one OHLCV row per trading day, "weekly" aggregates to weekly bars, "monthly" aggregates to monthly bars. Default: "daily". |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"tickers"
],
"properties": {
"days": {
"type": "integer",
"default": 252,
"maximum": 1260,
"minimum": 1,
"description": "Number of historical trading days to return. Free tier: max 252 days (~1 year). Paid tier: up to 1260 days (~5 years). Default: 252."
},
"tickers": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1
},
"maxItems": 20,
"minItems": 1,
"description": "Ticker symbols to fetch price history for. Free tier: max 1 ticker. Paid tier: up to 20 tickers."
},
"interval": {
"enum": [
"daily",
"weekly",
"monthly"
],
"type": "string",
"default": "daily",
"description": "Price interval. \"daily\" returns one OHLCV row per trading day, \"weekly\" aggregates to weekly bars, \"monthly\" aggregates to monthly bars. Default: \"daily\"."
}
},
"additionalProperties": false
}Break down portfolio exposure by GICS sector, market cap, and asset class. Returns concentration metrics including the Herfindahl-Hirschman Index.
| Argument | Type | Description |
|---|---|---|
| positions* | array | Array of portfolio positions to analyze. Returns GICS sector weights, market cap breakdown, and concentration metrics. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"positions"
],
"properties": {
"positions": {
"type": "array",
"items": {
"type": "object",
"required": [
"ticker",
"quantity"
],
"properties": {
"ticker": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol, e.g. AAPL or MSFT. Must be uppercase, 1-10 characters."
},
"quantity": {
"type": "number",
"description": "Number of shares held. Use a negative value to represent a short position."
},
"cost_basis": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Per-share cost basis in USD. Optional — used only for P&L calculations."
}
},
"additionalProperties": false
},
"maxItems": 500,
"minItems": 1,
"description": "Array of portfolio positions to analyze. Returns GICS sector weights, market cap breakdown, and concentration metrics."
}
},
"additionalProperties": false
}Stress test a portfolio against historical crisis scenarios (GFC 2008, COVID 2020, etc.) or custom shocks (paid tier).
| Argument | Type | Description |
|---|---|---|
| positions* | array | Array of portfolio positions. Free tier: max 20 positions and historical scenarios only. Paid tier: up to 500 positions plus custom shocks. |
| scenarios | array | Historical scenarios to run. Available values: gfc_2008, covid_2020, dot_com_2000, black_monday_1987, taper_tantrum_2013, rate_hike_2022, volmageddon_2018, euro_crisis_2011. Default: [gfc_2008, covid_2020]. |
| custom_shocks | any | Custom shock definitions. PAID tier only. Each shock specifies ticker-level, sector-level, or market-wide price changes. |
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"positions"
],
"properties": {
"positions": {
"type": "array",
"items": {
"type": "object",
"required": [
"ticker",
"quantity"
],
"properties": {
"ticker": {
"type": "string",
"pattern": "^[A-Z0-9.^-]{1,10}$",
"maxLength": 10,
"minLength": 1,
"description": "Ticker symbol, e.g. AAPL or MSFT. Must be uppercase, 1-10 characters."
},
"quantity": {
"type": "number",
"description": "Number of shares held. Use a negative value to represent a short position."
},
"cost_basis": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"description": "Per-share cost basis in USD. Optional — used only for P&L calculations."
}
},
"additionalProperties": false
},
"maxItems": 500,
"minItems": 1,
"description": "Array of portfolio positions. Free tier: max 20 positions and historical scenarios only. Paid tier: up to 500 positions plus custom shocks."
},
"scenarios": {
"type": "array",
"items": {
"enum": [
"gfc_2008",
"covid_2020",
"dot_com_2000",
"black_monday_1987",
"taper_tantrum_2013",
"rate_hike_2022",
"volmageddon_2018",
"euro_crisis_2011"
],
"type": "string"
},
"default": [
"gfc_2008",
"covid_2020"
],
"description": "Historical scenarios to run. Available values: gfc_2008, covid_2020, dot_com_2000, black_monday_1987, taper_tantrum_2013, rate_hike_2022, volmageddon_2018, euro_crisis_2011. Default: [gfc_2008, covid_2020]."
},
"custom_shocks": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 50,
"minLength": 1,
"description": "Name for this custom scenario, e.g. 'Rate spike +300bps'. 1-50 characters."
},
"market_shock": {
"type": "number",
"maximum": 1,
"minimum": -1,
"description": "Broad market shock applied to all positions not covered by ticker_shocks or sector_shocks. e.g. -0.10 = market down 10%. Range: -1.0 to 1.0."
},
"sector_shocks": {
"type": "object",
"description": "Per-sector shocks applied to all positions in that sector. e.g. { Technology: -0.15 }. Range: -1.0 to 1.0.",
"additionalProperties": {
"type": "number",
"maximum": 1,
"minimum": -1
}
},
"ticker_shocks": {
"type": "object",
"description": "Per-ticker price shocks as decimals, e.g. { AAPL: -0.20 } = AAPL drops 20%. Range: -1.0 to 1.0.",
"additionalProperties": {
"type": "number",
"maximum": 1,
"minimum": -1
}
}
},
"additionalProperties": false
}
},
{
"type": "null"
}
],
"description": "Custom shock definitions. PAID tier only. Each shock specifies ticker-level, sector-level, or market-wide price changes."
}
},
"additionalProperties": false
}