Set Up DeFi Position Alerts with Webhooks

Syenite's alert tools let an agent watch lending positions across Aave v3, Morpho Blue, and Spark. When a health factor drops toward a threshold or an LTV approaches a liquidation boundary, the agent can surface a warning and suggest remediation before the position is at risk. This page covers what alerts monitor, how to set them up, and how to forward alert data to a webhook.

what position alerts monitor

Syenite monitors three conditions for registered positions:

alert types and thresholds

Alert type Trigger condition Recommended threshold
Health factor warning Health factor falls below threshold 1.5 (warning) / 1.2 (critical)
LTV proximity LTV within 10% of max liquidation LTV Protocol-dependent; check max LTV in risk.assess
Rate spike Borrow APR increases by more than N% in 24 hours 2% absolute change (adjust to position size)
Liquidation proximity Position within 5% of liquidation price Immediate notification required

step-by-step setup

Step 1: register the position

Call alerts.watch with the wallet address, protocol, chain, and health factor threshold. Returns a watch ID.

"tool": "alerts.watch",
"arguments": {
  "address": "0xYourWalletAddress",
  "protocol": "aave-v3",
  "chain": "ethereum",
  "healthFactorThreshold": 1.5
}

Save the returned watchId — you will use it to poll for alerts and remove the watch when done.

Step 2: poll for alerts

Call alerts.check on a schedule (every 1–5 minutes for active positions). Pass the watch ID to filter results. Set acknowledge: true to clear the alert after processing.

"tool": "alerts.check",
"arguments": {
  "watchId": "watch_abc123",
  "acknowledge": false
}

The response includes alertCount, critical, warning, and an array of alert objects. Each alert has type, severity, message, and data (current health factor, threshold, position details).

Step 3: forward to a webhook

The alerts.check response is JSON. Your backend script or agent reads it and forwards to your notification endpoint. Example using curl in a polling script:

#!/bin/bash
RESPONSE=$(curl -s -X POST https://syenite.ai/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"alerts.check","arguments":{"watchId":"watch_abc123"}}}')

ALERT_COUNT=$(echo $RESPONSE | jq '.result.content[0].text | fromjson | .alertCount')

if [ "$ALERT_COUNT" -gt "0" ]; then
  curl -s -X POST https://your-webhook.example.com/defi-alerts \
    -H "Content-Type: application/json" \
    -d "$RESPONSE"
fi

Step 4: remove the watch when done

Call alerts.remove with the watch ID to stop monitoring and free server-side state.

"tool": "alerts.remove",
"arguments": { "watchId": "watch_abc123" }

faq

How often are alerts checked?

Syenite checks watched positions on each call to alerts.check. The tool does not push alerts independently — your agent or polling script calls alerts.check on a schedule. For active positions, polling every 1–5 minutes is recommended.

What webhook formats are supported?

Syenite returns alert data as structured JSON from alerts.check. Your agent or backend is responsible for forwarding that data to a webhook endpoint. The JSON payload includes alert type, severity, current health factor, threshold, and position details.

Can I get SMS or email alerts?

Syenite does not send SMS or email directly. Your integration layer (a backend script, a Zapier workflow, or an agent with notification tools) reads alerts.check output and routes notifications to SMS, email, or Slack as needed.

What happens when a position is liquidated?

Syenite alerts are designed to warn before liquidation, not after. If a health factor drops below 1.0, the position is already liquidatable on-chain. Set your healthFactorThreshold to at least 1.3–1.5 to receive warnings with time to act.

see also

Position alerts and carry screening — full alerts workflow including carry screening. Build a DeFi AI agent — how to integrate alert monitoring into a broader agent architecture. Lending rates and risk — how to assess a position before opening it.