AgentLoan

DEFI AGENTS

AgentLoan runs four autonomous agents — a Personal Agent for your positions, an AI Coordinator, a Liquidation Bot, and a Signal Agent.

Agent Architecture
AgentLoan agents run 24/7 on dedicated infrastructure. Personal Agent manages your individual position. Protocol Manager (Coordinator + Oracle Keeper) keeps the system healthy. Liquidation Bot executes liquidations and earns rewards. Signal Agent sells early warnings via the x402 payment protocol.

01 — PERSONAL AGENT

Your autonomous DeFi autopilot. Set up once — agent monitors your Health Factor 24/7, automatically repays debt when HF drops below your target, and deploys idle xUSDC to earn yield. Uses Gemini AI with rolling memory to make context-aware decisions.

HOW IT WORKS
Every 10s: read your Health Factor (Multicall3, $0)
├─ HF < 1.05 → emergency repay immediately (no LLM)
├─ HF < target → call Gemini with memory context → repay
├─ HF safe + idle xUSDC in wallet → deploy to yield
└─ After action → save to memory → notify via Telegram
LLM cooldown: 5 minutes per user (prevents over-calling)
Memory: rolling 50 entries → LLM learns your position patterns
PropertyValue
AI modelGemini 2.5 Flash (default) — user can set own key
Trigger (emergency)HF < 1.05 — acts immediately, skips LLM
Trigger (normal)HF < target — calls LLM with memory context
Cooldown5 minutes between LLM calls per user
Yield deploymentDeploys idle wallet xUSDC when HF > target + 0.3
ExecutionAgentExecutor contract — atomic withdrawFor + repayFor
Arc ERC-8004 ID#67459
SetupDashboard → AGENTS tab → approve + authorize + activate
Bring your own LLM
By default the agent uses the protocol's Gemini key (shared). Open the AI Reasoning section in the AGENTS tab to add your own Gemini, OpenAI, or DeepSeek API key for dedicated capacity.

02 — COORDINATOR AGENT

The brain of the liquidation system. Runs every 30 seconds and uses Gemini AI to reason about liquidation strategy. Considers profit, urgency, and market conditions to produce a priority-ordered liquidation queue. Learns from past outcomes via persistent memory.

TWO-TIER DECISION SYSTEM
Tier 1 — Scoring function (always, $0)
├─ Score = profit × 0.4 + urgency(HF) × 0.6
└─ Ranks ALL positions instantly
Tier 2 — Gemini AI (only on real events)
├─ BTC/collateral price change > 1.5%
├─ New position crosses HF 1.05 or 1.02
└─ 5-minute minimum between AI calls
PropertyValue
AI modelGemini 2.5 Flash (primary) + DeepSeek V3 (fallback)
Cost at scale~$0.01–0.02/day regardless of user count
Agent wallet0x4dcE343E9c35112AAF9Ddce566689C3f36C73482
Arc ERC-8004 ID#34625

03 — LIQUIDATION BOT

Executes the Coordinator's strategy. Monitors every borrower position every block (~0.48s) and liquidates positions with HF < 1.0, earning a 5% collateral bonus.

PropertyValue
Reaction time~15 seconds (oracle staleness threshold)
Collateral bonus5% of debt value
Bot wallet0x9E47c5EE0b1174a5F4450553CE45Fdcf6bCd036a
Arc ERC-8004 ID#30907
Testnet only. Anyone can run their own liquidation bot — see github.com/PigAssasin/agentloan.

04 — SIGNAL AGENT

Sells early liquidation warnings to bots via x402 payment protocol. Scans all positions every 5 seconds for HF < 1.1. Bots pay 1 xUSDC for 1,000 signals (24h session) and get a 15–30 second head start.

PropertyValue
Price1 xUSDC per session (1,000 signals / 24h)
Scan interval5 seconds
Agent wallet0x555cc39B822392E45A0B69776d6AeEadfcC5af3D
Arc ERC-8004 ID#31772

AGENT COMPARISON

AgentForRunsTrigger
Personal AgentYour positionVPS (every block)HF < your target
CoordinatorProtocol efficiencyVPS (every 30s)Positions HF < 1.1
Liquidation BotProtocol + bot operatorVPS (every block)HF < 1.0
Signal AgentBot subscribersVPS (every 5s)Positions HF < 1.1
LIVE STATUS

Check live agent status in Dashboard → AGENTS tab. Personal Agent setup: approve xUSDC → authorize → activate.