GET /v1/monitor/:wallet
Real-time risk monitoring for all open positions in a wallet. Returns per-position risk scores, liquidation proximity, funding drag, and portfolio-level stress analysis.
Request
GET https://api.canonprotocol.org/v1/monitor/0x7a3b1234567890abcdef1234567890abcdef1234
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer YOUR_API_KEY |
Response
{
"wallet": "0x7a3b1234567890abcdef1234567890abcdef1234",
"account_value": 125000.00,
"total_margin_used": 45000.00,
"positions": [
{
"asset": "BTC",
"size": 0.75,
"entry_price": 67500.00,
"mark_price": 68100.00,
"unrealized_pnl": 450.00,
"unrealized_pnl_pct": 6.67,
"risk_score": 28,
"recommendation": "proceed",
"flags": [],
"liquidation_distance_pct": 8.5,
"funding_drag_24h_pct": 0.03,
"var": {
"pct_95_24h": 3.8,
"pct_99_24h": 6.2,
"dollar_95_24h": 1900,
"dollar_99_24h": 3100,
"lvar_95_24h": 2050,
"lvar_99_24h": 3350,
"es_95_24h": 4.8,
"es_99_24h": 7.9,
"margin_var_99_pct": 62.0
}
}
],
"portfolio_risk": {
"portfolio_var_99_24h": 5200,
"portfolio_es_99_24h": 8100,
"position_count": 2
},
"portfolio_stress": {
"scenario": "luna_collapse",
"total_pnl_usd": -32000,
"total_pnl_pct": -25.6,
"total_funding_cost_pct": 4.1,
"account_survives": true,
"positions_liquidated": 0
}
}
Position Fields
| Field | Type | Description |
|---|---|---|
asset | string | Asset ticker |
size | number | Position size in asset units (positive = long, negative = short) |
entry_price | number | Average entry price |
mark_price | number | Current mark price |
unrealized_pnl | number | Unrealized P&L in USD |
unrealized_pnl_pct | number | Unrealized P&L as percentage of margin |
risk_score | number | Current risk score (0-100) |
recommendation | string | Current recommendation based on risk score |
flags | string[] | Active risk flags |
liquidation_distance_pct | number | Distance to liquidation as percentage |
funding_drag_24h_pct | number | Projected 24h funding cost as percentage |
var | object | Current Value-at-Risk for this position |
Use this endpoint to implement exit signals: when risk_score rises above your threshold or liquidation_distance_pct drops below 5%, consider closing the position.