riskofficerPortfolio risk management and analytics. Use when user asks to create a portfolio, generate auto portfolio, calculate VaR, run Monte Carlo, stress test, opti...
Install via ClawdBot CLI:
clawdbot install mib424242/riskofficerThis skill connects to RiskOfficer API to manage investment portfolios and calculate risks.
RISK_OFFICER_TOKEN=ro_pat_...Or configure in ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"riskofficer": {
"enabled": true,
"apiKey": "ro_pat_..."
}
}
}
}
https://api.riskofficer.tech/api/v1
All requests require header: Authorization: Bearer ${RISK_OFFICER_TOKEN}
When user asks to see their portfolios, list portfolios, or show portfolio overview:
curl -s "https://api.riskofficer.tech/api/v1/portfolios/list" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Response contains array of portfolios with: id, name, total_value, currency, positions_count, broker, sandbox.
When user asks about a specific portfolio or wants to see positions:
curl -s "https://api.riskofficer.tech/api/v1/portfolio/snapshot/{snapshot_id}" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Response contains: name, total_value, currency, positions (array with ticker, quantity, current_price, value, weight).
When user asks for portfolio history, how portfolio changed over time, or list of past snapshots:
curl -s "https://api.riskofficer.tech/api/v1/portfolio/history?days=30" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Query params: days (optional, default 30, 1–365). Response: snapshots array with snapshot_id, timestamp, total_value, positions_count, sync_source, type (aggregated/manual/broker), name, broker, sandbox.
When user wants to compare two portfolio states (e.g. before/after rebalance, or two dates):
curl -s "https://api.riskofficer.tech/api/v1/portfolio/snapshot/{snapshot_id}/diff?compare_to={other_snapshot_id}" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Response: added/removed/modified positions, total_value_delta. Both snapshots must belong to the user.
When user asks for total/combined portfolio, overall position, or "show everything together":
curl -s "https://api.riskofficer.tech/api/v1/portfolio/aggregated?type=all" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Query params:
type=production — manual + broker (sandbox=false)type=sandbox — broker (sandbox=true) onlytype=all — everything (default)Response:
portfolio.positions — all positions merged across portfoliosportfolio.total_value — total value in base currencyportfolio.currency — base currency (RUB or USD)portfolio.sources_count — number of portfolios aggregatedExample response:
{
"portfolio": {
"positions": [
{"ticker": "SBER", "quantity": 150, "value": 42795, "sources": ["Т-Банк", "Manual"]},
{"ticker": "AAPL", "quantity": 10, "value": 189500, "original_currency": "USD"}
],
"total_value": 1500000,
"currency": "RUB",
"sources_count": 3
},
"snapshot_id": "uuid-of-aggregated"
}
Currency conversion: Positions in different currencies are automatically converted to base currency using current exchange rates (CBR for RUB).
When user wants to see aggregated portfolio in different currency:
curl -s -X PATCH "https://api.riskofficer.tech/api/v1/portfolio/{aggregated_snapshot_id}/settings" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"base_currency": "USD"}'
Supported currencies: RUB, USD
After changing, aggregated portfolio recalculates automatically.
User prompt examples:
When user wants to exclude a portfolio from total calculation:
curl -s -X PATCH "https://api.riskofficer.tech/api/v1/portfolio/{snapshot_id}/settings" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"include_in_aggregated": false}'
Use cases:
When user wants to create a new portfolio with specific positions:
curl -s -X POST "https://api.riskofficer.tech/api/v1/portfolio/manual" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "Portfolio Name",
"positions": [
{"ticker": "SBER", "quantity": 100},
{"ticker": "GAZP", "quantity": 50}
]
}'
IMPORTANT RULE - Single Currency:
All assets in a portfolio must be in the same currency.
Cannot mix! If user tries to mix currencies, explain and suggest creating separate portfolios.
When user wants to modify an existing portfolio:
curl -s "https://api.riskofficer.tech/api/v1/portfolio/snapshot/{snapshot_id}" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
curl -s -X POST "https://api.riskofficer.tech/api/v1/portfolio/manual" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "<same name from step 1>",
"positions": [<updated list of all positions>]
}'
IMPORTANT: Always show user what will change and ask for confirmation before updating.
When user asks about connected brokers or broker status:
curl -s "https://api.riskofficer.tech/api/v1/brokers/connections" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
When user wants to sync/update portfolio from Tinkoff (broker must be connected via app):
curl -s -X POST "https://api.riskofficer.tech/api/v1/portfolio/proxy/broker/tinkoff/portfolio" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"sandbox": false}'
If response is 400 with missing_api_key, broker is not connected. Explain how to connect:
When user asks to calculate risks, VaR, or risk metrics:
curl -s -X POST "https://api.riskofficer.tech/api/v1/risk/calculate-var" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"portfolio_snapshot_id": "{snapshot_id}",
"method": "historical",
"confidence": 0.95,
"horizon_days": 1,
"force_recalc": false
}'
historical, parametric, garch"force_recalc": true. Otherwise the API may return a cached result when prices have not changed.This returns calculation_id. Poll for result:
curl -s "https://api.riskofficer.tech/api/v1/risk/calculation/{calculation_id}" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Wait until status is done, then present results. If the POST response already has status: "done" and var_95/cvar_95 (cached result), you can present those without polling.
When user asks for last risk calculations, previous VaR results, or "show my risk history":
curl -s "https://api.riskofficer.tech/api/v1/risk/history?limit=50" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Query params: limit (optional, default 50, max 100).
Response: calculations array with calculation_id, portfolio_snapshot_id, status, method, var_95, cvar_95, sharpe_ratio, created_at, completed_at. Use to show a short list of recent VaR runs or to let user pick a past result.
When user asks for Monte Carlo simulation:
curl -s -X POST "https://api.riskofficer.tech/api/v1/risk/monte-carlo" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"portfolio_snapshot_id": "{snapshot_id}",
"simulations": 1000,
"horizon_days": 365,
"model": "gbm"
}'
Poll: GET /api/v1/risk/monte-carlo/{simulation_id}
When user asks for stress test:
First, get available crises:
curl -s "https://api.riskofficer.tech/api/v1/risk/stress-test/crises" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Then run stress test:
curl -s -X POST "https://api.riskofficer.tech/api/v1/risk/stress-test" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"portfolio_snapshot_id": "{snapshot_id}",
"crisis": "covid_19"
}'
Poll: GET /api/v1/risk/stress-test/{stress_test_id}
When user asks to optimize portfolio or balance risks:
curl -s -X POST "https://api.riskofficer.tech/api/v1/portfolio/{snapshot_id}/optimize" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"optimization_mode": "preserve_directions",
"constraints": {
"max_weight": 0.30,
"min_weight": 0.02
}
}'
Modes:
long_only: All weights ≥ 0preserve_directions: Keep long/short as-isunconstrained: Any direction allowedPoll: GET /api/v1/portfolio/optimizations/{optimization_id}
Result: GET /api/v1/portfolio/optimizations/{optimization_id}/result
When user asks for Calmar optimization, maximize Calmar Ratio (CAGR / |Max Drawdown|). Requires 200+ trading days of price history per ticker (backend requests 252 days). If user has short history, suggest Risk Parity instead.
curl -s -X POST "https://api.riskofficer.tech/api/v1/portfolio/{snapshot_id}/optimize-calmar" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"optimization_mode": "long_only",
"constraints": {
"max_weight": 0.50,
"min_weight": 0.05,
"min_expected_return": 0.0,
"max_drawdown_limit": 0.15,
"min_calmar_target": 0.5
}
}'
Poll: GET /api/v1/portfolio/optimizations/{optimization_id} (check optimization_type === "calmar_ratio").
Result: GET /api/v1/portfolio/optimizations/{optimization_id}/result — includes current_metrics, optimized_metrics (cagr, max_drawdown, calmar_ratio, recovery_time_days).
Apply: same as Risk Parity — POST /api/v1/portfolio/optimizations/{optimization_id}/apply.
IMPORTANT: Always show rebalancing plan and ask for explicit user confirmation first!
curl -s -X POST "https://api.riskofficer.tech/api/v1/portfolio/optimizations/{optimization_id}/apply" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Note: Quant subscription is currently FREE for all users. All features work without payment.
When you need to check if user has Quant subscription:
curl -s "https://api.riskofficer.tech/api/v1/subscription/status" \
-H "Authorization: Bearer ${RISK_OFFICER_TOKEN}"
Currently all users have has_subscription: true (free tier enabled).
VaR, Monte Carlo, Stress Test, and Optimization are asynchronous.
Polling pattern:
calculation_id / simulation_id / optimization_idstatus field:pending or processing → keep pollingdone → present resultsfailed → show error messageTypical times:
| Operation | Typical Time |
|-----------|--------------|
| VaR | 3-10 seconds |
| Monte Carlo | 10-30 seconds |
| Stress Test | 5-15 seconds |
| Optimization | 10-30 seconds |
User communication:
User: "Show my portfolios"
→ Call GET /portfolios/list
→ Format nicely with values, positions count, last updated
User: "Покажи всё вместе" / "Total portfolio" / "Сколько у меня всего?"
→ Call GET /portfolio/aggregated?type=all
→ Show total value, all positions merged, sources count
→ Note which positions were converted from other currencies
User: "Покажи в долларах" / "Switch to USD"
→ Call PATCH /portfolio/{aggregated_id}/settings with {"base_currency": "USD"}
→ Call GET /portfolio/aggregated again
→ Show portfolio in new currency
User: "What are the risks of my main portfolio?"
→ Call GET /portfolios/list to find the portfolio
→ Call POST /risk/calculate-var
→ Poll until done
→ Present VaR, CVaR, volatility, risk contributions
→ Offer optimization if risks are unbalanced
User: "Оптимизируй портфель по Калмару" / "Optimize using Calmar Ratio" / "Maximize return per drawdown"
→ Call GET /portfolios/list or aggregated to get snapshot_id
→ Call POST /portfolio/{snapshot_id}/optimize-calmar with optimization_mode and optional constraints
→ If 400 INSUFFICIENT_HISTORY: explain need 200+ trading days of history, suggest Risk Parity as alternative
→ Poll GET /optimizations/{id} until status is done
→ Call GET /optimizations/{id}/result — show current_metrics vs optimized_metrics (Calmar ratio, CAGR, max drawdown)
→ Show rebalancing plan and ask for confirmation before apply
User: "Add Apple to my portfolio"
→ Check portfolio currency (RUB) vs AAPL currency (USD)
→ Explain cannot mix, suggest creating separate USD portfolio
User: "Run Monte Carlo"
→ Call POST /risk/monte-carlo with portfolio snapshot
→ Poll until done
→ Present simulation results with percentiles and projections
User: "Show my last VaR results" / "Previous risk calculations" / "История расчётов рисков"
→ Call GET /risk/history?limit=50
→ Present list of recent calculations (method, var_95, cvar_95, date)
User: "How did my portfolio change?" / "История портфеля"
→ Call GET /portfolio/history?days=30
→ Present snapshots (date, total_value, positions_count, source)
User: "Compare my portfolio now vs last week" / "Что изменилось в портфеле?"
→ Get two snapshot_ids from GET /portfolio/history (or from context)
→ Call GET /portfolio/snapshot/{snapshot_id}/diff?compare_to={other_snapshot_id}
→ Present added/removed/modified positions and value delta
Generated Mar 1, 2026
Financial advisors managing multiple client portfolios can use this skill to aggregate all holdings across different brokers into a single view. They can quickly assess overall exposure, identify concentration risks, and present unified performance reports to clients in their preferred currency.
Analysts at hedge funds can track portfolio changes over time using snapshot comparisons to monitor rebalancing effects. They can calculate Value at Risk (VaR) metrics, run stress tests on aggregated positions, and optimize allocations using Risk Parity strategies to maintain target risk levels.
Students learning portfolio management can create manual portfolios with hypothetical positions to practice risk calculations. They can compare different allocation strategies, simulate currency conversions between RUB and USD, and analyze how excluding sandbox portfolios affects aggregated risk metrics.
Investors holding assets in both Russian (RUB) and US (USD) markets can use the currency conversion feature to view their entire portfolio in a single base currency. They can toggle between RUB and USD reporting, automatically convert values using current exchange rates, and maintain separate currency-specific portfolios as required by the single-currency rule.
Developers at financial technology companies can use sandbox portfolios to test broker API integrations without affecting real investments. They can exclude test portfolios from aggregated calculations, compare snapshot diffs to verify data synchronization accuracy, and validate risk metric calculations across different portfolio types.
Offer tiered subscription plans based on portfolio count, advanced risk metrics (Monte Carlo simulations, Calmar Ratio optimization), and API call limits. Enterprise plans could include white-label reporting, custom currency support beyond RUB/USD, and dedicated support for financial institutions.
Charge based on API call volume, number of portfolio snapshots stored, and complexity of risk calculations. Higher-tier calculations like Monte Carlo simulations and stress tests would consume more credits. This model appeals to developers and automated trading systems that need scalable, pay-per-use access.
Provide customized enterprise solutions for banks, hedge funds, and wealth management firms with on-premise deployment options, SLA guarantees, and integration with existing risk management systems. Include training, dedicated support, and custom feature development for large institutional clients.
💬 Integration Tip
Always validate the RISK_OFFICER_TOKEN environment variable first, and implement proper error handling for API rate limits and authentication failures. Cache portfolio snapshots locally to reduce API calls when comparing historical data.
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.
Get stock prices, quotes, fundamentals, earnings, options, dividends, and analyst ratings using Yahoo Finance. Uses yfinance library - no API key required.
Yahoo Finance (yfinance) powered stock analysis skill: quotes, fundamentals, ASCII trends, high-resolution charts (RSI/MACD/BB/VWAP/ATR), plus optional web a...
Become an autonomous prediction market trader on Polymarket with AI-powered analysis and a performance-backed token on Base. Trade real markets, build a track record, and let the buyback flywheel run.
Get cryptocurrency token price and generate candlestick charts via CoinGecko API or Hyperliquid API. Use when user asks for token price, crypto price, price chart, or cryptocurrency market data.
Trade and monitor Hyperliquid perpetual futures. Check balances, view positions with P&L, place/cancel orders, execute market trades. Use when the user asks about Hyperliquid trading, portfolio status, crypto positions, or wants to execute trades on Hyperliquid.