Think of Soteria as your personal quant analyst. You speak in plain English; it quietly runs the right RiskFolio tool under the hood. Use this cheat‑sheet whenever you wonder “What should I ask, and which modes are available?”


Quick Start

“Optimize a minimum‑variance mix of AAPL, MSFT, NVDA; cap any stock at 20 %; plot the growth of $1.”

Soteria replies with weights, a pie chart, and a line chart asking you first if you want to place the trades. That’s the magic: one sentence, multiple tools. Read on for the full menu.

Download Historical Returns

Function: Retrieves historical price data and converts to percentage or logarithmic returns for analysis.

Key phrases: log returns, adjusted close, explicit date range.

Example prompt: “Fetch log returns for AAPL & MSFT from 2020‑01‑01.”


Plot Cumulative Growth

Function: Calculates and visualizes the compounded growth of portfolio value over time.

Key phrases: title.

Example prompt: “Plot cumulative growth; title Tech vs S&P.”


Show Allocation Pie

Function: Creates a visual pie chart representation of portfolio weight distributions.

Key phrases: title.

Example prompt: “Pie‑chart my optimized weights.”


Classic Mean‑Variance Optimization

Function: Performs traditional Markowitz style portfolio optimization (minimize variance wTΣww^T\Sigma w or maximize Sharpe) with various risk measures and objectives.

Key phrases: Classic / FM; risk measure (MV, CVaR, MDD, …); objective (Sharpe, MinRisk, Utility l=3); allow shorts.

Example prompt:Maximize Sharpe for these 10 stocks allow shorts 20 %; risk = CVaR 95 %.”


Optimization with Weight Limits

Function: Applies portfolio optimization while respecting user defined constraints on individual assets or asset classes.

Key phrases: “no stock above 12 %,” “Bonds ≥ 10 %.”

Example prompt: “Min‑variance; cap any stock at 15 %; Bonds ≥ 10 %.”


Hierarchical Clustering Optimization

Function: Creates portfolios using hierarchical risk parity methods that cluster similar assets before allocation.

Key phrases: model HRP, HERC, HERC2, NCO; dependency (pearson, distance); optional risk target.

Example prompt: “Create an HRP portfolio of these 30 ETFs; minimize variance.”


Estimate Expected Returns

Function: Generates forward looking return estimates using various statistical (historical or shrinkage estimators) approaches.

Method keywordIdea (math‑lite)When useful
histSimple arithmetic meanStable markets, long history
EWMA λWeighted mean (1‑λ)Σλ^t r_tEmphasize recent data or regime shifts
James‑SteinShrink toward grand meanMany assets, small sample
Bayes‑SteinShrink toward prior beliefExpect modest excess returns
BOPFully Bayesian posteriorNeed probabilistic estimates

Key phrases: any method keyword above (e.g. EWMA λ 0.94).

Example prompt: “Estimate mean returns with EWMA λ 0.94.”


Estimate Covariance Matrix

Function: Computes asset correlation and volatility relationships using robust statistical estimators.

Method keywordIdeaWhen useful
histSample covariancePlenty of observations per asset
LedoitShrink toward identityMany assets, noisy sample
EWMADecay‑weighted covarianceVolatility clustering, recent shocks
semiDownside semi‑covarianceFocus on downside risk only
kernelNon‑parametric smoothingHeavy tails or nonlinear dependence

Key phrases: any keyword above + detone market (removes first PC).

Example prompt: “Use Ledoit covariance and detone market.”


Compute Cokurtosis Matrix

Function: Analyzes higher order statistical moments to capture tail risk and extreme event dependencies (estimates fourth order co‑moments Kijkl=E[(riμi)(rlμl)]K_{ijkl}=E[(r_i-\mu_i)…(r_l-\mu_l)] to capture tail dependence).

Key phrases: alpha 0.05, method (hist, exp).

Example prompt: “Cokurtosis alpha 0.05 for FAANG.”


Risk‑Adjusted Sharpe Ratio

Function: Calculates risk adjusted returns using various risk measures beyond standard deviation (SR=μprfρ(p)\text{SR}=\frac{\mu_p-r_f}{\rho(p)} where ρ\rho may be variance, CVaR, MDD, etc).

Key phrases: risk keyword (CVaR, MDD, MAD, …).

Example prompt: “Sharpe using CVaR at 95 % for these weights.”


Single Risk Metric

Function: Computes individual risk statistics for detailed portfolio analysis and comparison.

MetricDescription
MADMean absolute deviation
MDD_RelRelative max drawdown
SemiDeviationDownside deviation
Kurtosis4th‑moment fat‑tailness

Key phrases: any metric keyword above.

Example prompt: “Compute MDD_Rel for BTC daily returns.”


Build Portfolio Return Series

Function: Constructs time series of portfolio performance with flexible rebalancing options.

Key phrases: rebalance true (monthly) or rebalance false (buy‑and‑hold).

Example prompt: “Portfolio returns with quarterly rebalancing.”


Export CSV Report

Function: Generates a CSV containing dates, asset returns, portfolio return, variance, CVaR, Sharpe.

Key phrases: (no extra keywords).

Example prompt: “Export a CSV performance report.”


Quick Cheat Sheet

CapabilityKey phrasesPrompt snippet
Download returnslog returns, adjusted, dates“log returns for AAPL 2020‑01‑01”
Plot growthtitle“plot growth title: Tech vs S&P”
Pie charttitle“pie‑chart weights”
Classic optimizerisk (CVaR 95 %), Sharpe, allow shorts“Max‑Sharpe CVaR 95 % allow shorts”
Caps optimizecaps/floors text“cap stock ≤ 12 %”
HRP/HERCHRP, minimize variance“HRP minimize variance”
Mean vectorEWMA λ, James‑Stein“mean James‑Stein”
CovarianceLedoit, detone“Ledoit covariance detone”
Cokurtosisalpha 0.05“cokurtosis alpha 0.05”
Sharpe ratiorisk keyword“Sharpe CVaR”
Risk metricmetric keyword“MDD_Rel BTC”
Portfolio seriesrebalance true/false“returns quarterly rebalance”
Export CSV-“export CSV”