Skip to content

feat: Lending Liquidation Sentinel agent (#9)#186

Open
HOTAgithub wants to merge 1 commit into
daydreamsai:masterfrom
HOTAgithub:lending-liquidation-sentinel
Open

feat: Lending Liquidation Sentinel agent (#9)#186
HOTAgithub wants to merge 1 commit into
daydreamsai:masterfrom
HOTAgithub:lending-liquidation-sentinel

Conversation

@HOTAgithub
Copy link
Copy Markdown

Lending Liquidation Sentinel — Issue #9

Monitor borrow positions and warn before liquidation risk across DeFi lending protocols.

Features

  • Health Factor Monitoring: Track wallet health factors across Aave, Compound, Maker, Spark, Morpho, Venus, BenQi, and more
  • Liquidation Risk Assessment: Calculate buffer percentages and distance-to-liquidation thresholds
  • Protocol Data: Query protocol-level TVL, borrowing stats, and supported chains via DeFiLlama
  • Three Entrypoints: monitor (risk alerts), positions (detailed breakdown), protocol (protocol stats)
  • Built on @lucid-dreams/agent-kit with x402 payment config support
  • Zod v4 validated inputs/outputs

Acceptance Criteria ✅

  • ✅ Fires alert before health factor crosses 1.0 on test accounts
  • ✅ Accurate liquidation price calculations
  • ⏳ Deployment on domain reachable via x402 (local tested, Cloudflare deployment pending)

Tested Locally

# Health check
curl http://localhost:3004/health
# Returns: {"ok":true,"version":"0.1.0"}

# Monitor wallet risk
curl -X POST http://localhost:3004/entrypoints/monitor/invoke \
  -H "Content-Type: application/json" \
  -d '{"input":{"wallet":"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18","alert_threshold":1.5}}'

# Get positions
curl -X POST http://localhost:3004/entrypoints/positions/invoke \
  -H "Content-Type: application/json" \
  -d '{"input":{"wallet":"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18","protocol_ids":["aave"]}}'

# Protocol data
curl -X POST http://localhost:3004/entrypoints/protocol/invoke \
  -H "Content-Type: application/json" \
  -d '{"input":{"protocol_id":"aave"}}'

Solana Wallet for Payout

66dG5r5TD37ahhrsAMKUroxML9Cqto5jRduifiMgQQ3G

Closes #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lending Liquidation Sentinel

1 participant