Portfolio Risk Analysis
Analyze portfolio risk exposure across DeFi vaults.
Use the portfolio endpoint to assess risk across all DeFi positions for an address.
Fetch Positions
curl https://api.philidor.io/v1/address/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/positionsThe response includes:
- Each vault position with its risk score, APR, and TVL
- A portfolio summary with weighted risk score and total value
Interpret Weighted Risk
The weighted risk score accounts for position sizes:
weighted_risk = SUM(position_value × vault_score) / total_valueA portfolio might have a weighted risk of 7.8 even if it includes Edge-tier vaults — if those positions are small relative to Prime-tier holdings.
Concentration Analysis
Look for concentration risks:
Protocol Concentration
If 80% of value is in one protocol, a single exploit affects most of the portfolio.
const byProtocol = positions.reduce(
(acc, p) => {
acc[p.protocol_name] = (acc[p.protocol_name] || 0) + parseFloat(p.balance_usd);
return acc;
},
{} as Record<string, number>
);Chain Concentration
All positions on one chain means exposure to chain-specific risks (bridge failures, sequencer downtime).
Curator Concentration
Multiple vaults managed by the same curator share curator risk.
Risk-Weighted Returns
Calculate risk-adjusted yield:
const riskAdjustedAPR = positions.map((p) => ({
name: p.vault_name,
apr: parseFloat(p.apr_net),
score: p.total_score,
ratio: parseFloat(p.apr_net) / (10 - p.total_score + 0.1), // Higher = better risk-adjusted return
}));Using the MCP Server
The portfolio_risk_assessment prompt automates this entire analysis:
"Assess the risk of my portfolio with 50% in Gauntlet USDC on Morpho and 50% in Aave V3 WETH"
See MCP Prompts for the full specification.