skills/financial/portfolio-management/SKILL.md
Manages investment portfolios with quantitative models, risk metrics, and optimization algorithms.
npx skillsauth add alphaonedev/openclaw-graph portfolio-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables the AI to manage investment portfolios using quantitative models, calculate risk metrics like Value at Risk (VaR), and apply optimization algorithms such as mean-variance optimization. It processes portfolio data to generate actionable insights, supporting decisions in finance by integrating with data sources and executing trades based on predefined strategies.
Use this skill for tasks involving portfolio rebalancing, risk assessment, or performance analysis in financial contexts. Apply it when handling user queries about investment strategies, such as diversifying assets or responding to market volatility. Ideal for scenarios with real-time data feeds or when optimizing allocations under constraints like budget limits.
claw portfolio model capm --assets AAPL,GOOG.GET /api/portfolios/risk/var?confidence=0.95 to get 95% VaR for a portfolio.{"assets": ["AAPL", "MSFT"], "weights": [0.5, 0.5]}.claw portfolio track --period monthly --metric sharpe.Always initialize with authentication via $PORTFOLIO_API_KEY environment variable. For CLI usage, pipe data inputs directly; e.g., start with claw portfolio load --file portfolio.json then chain commands like claw portfolio optimize --risk-level high. In API patterns, use POST requests for modifications and GET for queries; handle asynchronous operations by polling endpoints. For scripts, wrap in try-catch blocks to manage API failures, and use config files for reusable parameters like asset lists.
claw portfolio manage --action optimize --config config.json to optimize a portfolio; flags include --action (optimize, analyze), --config (path to JSON), and --verbose for detailed logs.POST /api/portfolios/create with body {"name": "my-portfolio", "assets": ["AAPL", "TSLA"]}; authenticate via header Authorization: Bearer $PORTFOLIO_API_KEY.import requests
response = requests.post('https://api.openclaw.ai/api/portfolios/optimize', headers={'Authorization': f'Bearer {os.environ["PORTFOLIO_API_KEY"]}'}, json={'assets': ['AAPL', 'GOOG']})
print(response.json()['optimized_weights'])
claw portfolio analyze --assets AAPL,MSFT --metric var --confidence 0.99
{"portfolio": {"assets": [{"symbol": "AAPL", "quantity": 100}], "constraints": {"max_risk": 0.05}}}; validate with claw portfolio validate --file config.json.Integrate by setting $PORTFOLIO_API_KEY in your environment before running commands. For external systems, use webhooks to sync data; e.g., connect to a brokerage API by mapping endpoints like POST /api/portfolios/update to trigger updates. Ensure compatibility with financial libraries like NumPy for calculations; import as a module in Python scripts and handle rate limits by adding delays, e.g., time.sleep(1) between API calls. Test integrations in a sandbox environment using mock data.
Check for authentication errors by verifying $PORTFOLIO_API_KEY is set; if missing, prompt user with os.environ.get('PORTFOLIO_API_KEY') or raise ValueError("API key required"). For API failures, catch HTTP errors like 401 or 429 using try-except in code:
try:
response = requests.get('https://api.openclaw.ai/api/portfolios/risk')
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.status_code} - {e.response.text}")
Handle invalid inputs by validating configs first with claw portfolio validate; log errors to file with --log-file errors.log flag, and retry transient errors up to 3 times with exponential backoff.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui