A user wants to deposit USDC into a Morpho vault. Before you queue the transaction, you want a current risk score that includes the user’s existing portfolio so concentration shows up.Documentation Index
Fetch the complete documentation index at: https://developer.alterscope.org/llms.txt
Use this file to discover all available pages before exploring further.
What you build
A pre-deposit check that hitsPOST /v2/portfolio/analyze with the proposed position appended, and refuses to proceed if the resulting risk band exceeds the user’s tolerance.
1. Build the request
2. Read the response
The response carries:risk.band(1 to 5; lower is safer).risk.dominant_factorslisting the top 3 factors driving the score.expected_apy_netnet of fees.scenarios(wheninclude_scenarios=true) with stress-test outputs.
3. Concentration warnings
If the sameprotocol or the same oracle.provider already accounts for more than 40% of the user’s notional, surface a warning regardless of band. The response includes a concentration block; render the top dimension to the user.
4. Troubleshooting
- 422 with “unknown opportunity_id”: the id you pass must match
data[].idfrom the yield list endpoint exactly. Fetch fresh; ids change on protocol upgrades. - Stale data: check
meta._agentic.freshness.status. If it’sstale, gate the deposit and surface the issue rather than approving on bad data.