Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Then create new snapshot with updated positions (use same name):
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.
Broker Integration
List Connected Brokers
When user asks about connected brokers or broker status:
Poll: GET /api/v1/portfolio/optimizations/{optimization_id}
Result: GET /api/v1/portfolio/optimizations/{optimization_id}/result
Calmar Ratio Optimization
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.
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.
Apply Optimization
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}"
Subscription Status
Note: Quant subscription is currently FREE for all users. All features work without payment.
Check Subscription
When you need to check if user has Quant subscription:
Currently all users have has_subscription: true (free tier enabled).
Async Operations
VaR, Monte Carlo, Stress Test, and Optimization are asynchronous.
Polling pattern:
Call POST endpoint → get calculation_id / simulation_id / optimization_id
Poll GET endpoint every 2-3 seconds
Check status field:
pending or processing → keep polling
done → present results
failed → show error message
Typical times:
Operation
Typical Time
VaR
3-10 seconds
Monte Carlo
10-30 seconds
Stress Test
5-15 seconds
Optimization
10-30 seconds
User communication:
Show "Calculating..." message immediately after starting
If polling takes >10 seconds, update: "Still calculating... please wait"
Always show result or error when complete
Important Rules
Single Currency Rule (Manual/Broker portfolios): Each individual portfolio must have same-currency assets. Cannot mix SBER (RUB) with AAPL (USD) in one manual portfolio. Suggest separate portfolios.
Aggregated Portfolio: The aggregated portfolio CAN contain assets in different currencies - they are automatically converted to base currency (RUB or USD) using CBR rates.
Subscription: Monte Carlo, Stress Test, and Optimization are Quant features (currently free for all users). VaR is always FREE.
Broker Integration: User must connect broker in RiskOfficer app first. Cannot connect via chat (security).
Confirmations: Before applying optimizations or making significant portfolio changes, always show what will change and ask for confirmation.
Async Operations: VaR, Monte Carlo, Stress Test, and Optimization are async. Poll for results.
Error Handling:
401 Unauthorized → Token invalid or expired, user needs to recreate
403 subscription_required → Need Quant subscription (currently free for all)
400 missing_api_key → Broker not connected
400 currency_mismatch → Mixed currencies
Example Conversations
User wants portfolio overview
User: "Show my portfolios"
→ Call GET /portfolios/list
→ Format nicely with values, positions count, last updated
User wants combined/total portfolio
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 wants to change display currency
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 wants to analyze risks
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 wants Calmar optimization
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 tries to mix currencies
User: "Add Apple to my portfolio"
→ Check portfolio currency (RUB) vs AAPL currency (USD)
→ Explain cannot mix, suggest creating separate USD portfolio
User requests Monte Carlo or Stress Test
User: "Run Monte Carlo"
→ Call POST /risk/monte-carlo with portfolio snapshot
→ Poll until done
→ Present simulation results with percentiles and projections