risk-management
Manages financial risks through quantitative analysis, modeling, and mitigation strategies.
What this skill does
# risk-management
## Purpose
This skill enables quantitative analysis, modeling, and mitigation of financial risks. It processes data to calculate metrics like Value at Risk (VaR), stress testing, and suggests strategies to reduce exposure, such as hedging or diversification.
## When to Use
Use this skill for scenarios involving financial uncertainty, like portfolio risk assessment, credit risk evaluation, or market volatility analysis. Apply it when you need data-driven insights to comply with regulations (e.g., Basel III) or optimize investment decisions.
## Key Capabilities
- Perform VaR calculations using historical or Monte Carlo simulations.
- Build risk models for market, credit, or operational risks with inputs like asset prices or default probabilities.
- Generate mitigation strategies, such as recommending stop-loss levels or portfolio rebalancing based on risk thresholds.
- Integrate with data sources for real-time analysis, supporting formats like CSV, JSON, or API feeds.
- Output results in structured formats, including reports or JSON for further processing.
## Usage Patterns
Always initialize with authentication via `$OPENCLAW_API_KEY`. For CLI, pipe data inputs directly; for API, use asynchronous calls for large datasets. Start by loading configuration files (e.g., YAML for model parameters). Common pattern: Analyze risk -> Review outputs -> Apply mitigation. For code integration, import the SDK and wrap calls in try-except blocks. Example 1: Analyze a stock portfolio's market risk by providing historical prices. Example 2: Evaluate credit risk for a loan portfolio and generate mitigation recommendations.
## Common Commands/API
Use the OpenClaw CLI for quick tasks or the REST API for programmatic access. Authentication requires setting `$OPENCLAW_API_KEY` in your environment.
- CLI Command: `openclaw risk analyze --type market --model var --input portfolio.csv --confidence 95`
This calculates 95% VaR for market risk; output is a JSON file with metrics.
- API Endpoint: POST https://api.openclaw.ai/v1/risk/analyze
Body: `{"type": "credit", "data": {"loans": [{"amount": 100000, "rating": "A"}]}, "model": "default-prob"}`
Response: JSON object with risk score and strategies, e.g., `{"var": 5000, "mitigation": ["increase collateral"]}`.
- Code Snippet (Python):
```python
import openclaw
openclaw.set_key(os.environ['OPENCLAW_API_KEY'])
result = openclaw.risk.analyze(type='operational', data={'events': [100, 200]}, model='monte-carlo')
print(result['mitigation'])
```
- Config Format: YAML for custom models, e.g.,
```
model:
type: var
parameters:
window: 252 # trading days
confidence: 0.95
```
## Integration Notes
Integrate by setting `$OPENCLAW_API_KEY` and using the SDK in your application. For web apps, handle webhooks for asynchronous results (e.g., POST to your endpoint on completion). Connect to data providers like Bloomberg via custom adapters; specify in config: `{"data_source": "bloomberg", "api_endpoint": "https://api.bloomberg.com/data"}`. Ensure compatibility with other OpenClaw skills by chaining outputs, e.g., pipe risk analysis results into a financial-analysis skill.
## Error Handling
Always validate inputs before commands (e.g., check for required fields like `--input`). For API calls, catch HTTP errors: if status >= 400, retry up to 3 times with exponential backoff. Common errors: 401 (unauthorized – check `$OPENCLAW_API_KEY`), 400 (bad request – verify JSON schema), or 500 (server error – log and notify). In code, use:
```python
try:
result = openclaw.risk.analyze(...)
except openclaw.APIError as e:
if e.status == 401:
print("Reauthenticate with $OPENCLAW_API_KEY")
else:
raise
```
Log all errors with timestamps and include debug flags, e.g., `openclaw risk analyze --debug`.
## Graph Relationships
- Related to: financial-analysis (shares finance tag for combined data processing), portfolio-management (uses risk outputs for optimization).
- Connected via: quantitative-analysis (common modeling techniques), mitigation-strategies (links to compliance tools).
- Dependencies: Requires financial cluster skills for data input; provides outputs for decision-making skills.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.