Creates a risk monitor, pre-liquidation check, or post-liquidation action hook.
Path Parameters
Body Parameters
One of monitorRisk, beforeLiquidation, or afterLiquidation.
Display name (max 128 chars). Defaults to a name based on the hook type.
URL to poll for risk data. Required for monitorRisk hooks.
Array of field checks applied to the risk URI response. Each object has path (dot-notation), optional operator (>, >=, <, <=, ==, !=), and optional threshold.
Polling interval for monitorRisk hooks. One of 1m, 5m, 15m, 30m, 1h, 6h, 12h, 24h.
Array of on-chain parameter checks for beforeLiquidation hooks. Each object has parameter (healthFactor, collateralValue, debtValue, collateralRatio, interestAccrued), operator, and threshold.
Required for afterLiquidation hooks. buy (auto-bid on auctions) or inform (send webhook).
Maximum price per token for buy action hooks.
Webhook URL for inform action hooks.
Additional fields merged into webhook payloads.
Array of hook IDs whose failure triggers this hook. Max 10.
curl -X POST "https://api.trusset.org/lending-stocks/api/hooks/{marketId}" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"hookType": "monitorRisk",
"name": "External Risk Feed",
"riskUri": "https://risk.example.com/api/score",
"riskFields": [{"path": "score", "operator": "<", "threshold": 50}],
"checkFrequency": "5m"
}'
{
"success": true,
"data": {
"id": "hook_002",
"marketId": "clx_market_001",
"hookType": "monitorRisk",
"name": "External Risk Feed",
"riskUri": "https://risk.example.com/api/score",
"riskFields": [{"path": "score", "operator": "<", "threshold": 50}],
"checkFrequency": "5m",
"active": true,
"executionCount": 0
}
}