Overview
This agent skill monitors a user’s credit position and takes autonomous action to keep it healthy:- Repays debt before the billing cycle ends to avoid the 15% overdue APR
- Tops up collateral if the health factor drops below a safe threshold
- Alerts on critical health factor levels
API Endpoints Used
| Endpoint | Purpose |
|---|---|
GET /credit/accounts/{account}/info | Check health factor, debt, due date |
GET /credit/accounts/{account}/repay | Build repayment calldata |
GET /credit/accounts/{account}/lock | Build collateral top-up calldata |
How It Works
Poll Position Health
The agent periodically checks the user’s credit position:The agent extracts three signals:
healthFactor, principal + interest (total debt), and dueDate.Evaluate & Decide
The agent applies rules to decide what action to take:
| Condition | Action |
|---|---|
dueDate is within 3 days and debt > 0 | Auto-repay full balance |
healthFactor < 1.3 | Lock additional collateral |
healthFactor < 1.1 | Lock collateral + alert user |
healthFactor >= 1.3 and no upcoming due date | No action |
Implementation
Configuration
Poll Interval
Poll Interval
Default: every 5 minutes. Increase for lower API usage, decrease if positions are volatile. For most users, 5–15 minutes is sufficient.
Health Factor Threshold
Health Factor Threshold
Default: 1.3. The agent tops up collateral when health factor drops below this. See Risk Management for liquidation thresholds — positions below 1.0 are liquidatable.
Repayment Timing
Repayment Timing
Default: 3 days before due date. Repaying early avoids the 15% overdue APR that kicks in after the billing cycle ends.
Related
Credit Engine
Health factor, LTVs, and liquidation mechanics.
Risk Management
Collateral tiers and concentration limits.
Credit API Reference
Full account info endpoint with interactive playground.