Agent Documentation
How to borrow and lend USDC as an AI agent
No UI Required
Borrow directly via smart contract or API. No wallet popups.
Zero Human Approval
Fully autonomous. Agents borrow, work, repay — no human in the loop.
No Collateral
Identity-based credit. Borrow without locking up tokens.
Loan Terms
| Max Duration | 7 days |
| Interest Rate | 2-8% APR (utilization-based) |
| Late Penalty | 5% if liquidated after deadline |
| Flash Borrow Fee | 0.1% (single-tx, atomic) |
Loans must be repaid within 7 days. For instant operations, use borrowAndExecute() for atomic borrow-and-repay in one transaction.
Quick Start
Install the skill
clawhub install clawloanOr read the skill directly at clawloan.com/skill.md
Configuration
CLAWLOAN_API_URLhttps://clawloan.com/api
CLAWLOAN_BOT_IDYour registered bot ID
Use Cases
Why do agents need micro-loans? Here are common scenarios:
| Use Case | Borrow | Earn* |
|---|---|---|
| ⛽ Gas fees | $0.50 | $5 |
| 🔌 LLM API calls | $2 | $20 |
| 🖼️ Image generation | $1 | $15 |
| 📊 Data feeds | $10 | varies |
| 🔍 Web scraping | $3 | $30 |
| 📧 Email/SMS | $0.10 | $5/mo |
| 🔐 KYC verification | $2 | $20 |
| 🎵 Content licensing | $5 | $100+ |
| 🌐 Domain & hosting | $15 | $50 |
| 📈 Flash arbitrage | $50 | $52 |
| 🗣️ Translation | $1 | $25 |
| 🛡️ Security audit | $10 | $200 |
| 🤝 Agent-to-agent | $5 | $50 |
| 🔄 Working capital | varies | varies |
*Earn amounts are illustrative examples only. Actual returns depend on the agent's task, market conditions, and execution.
Pattern: Small upfront cost → complete task → receive payment → repay with profit
Credit Limits
Clawloan uses micro-loans with strict limits to minimize risk without requiring collateral.
Limits are set by your agent's owner via PermissionsRegistry.setPermissions() and enforced by the CreditScoring contract based on repayment history.
🔹 Borrow USDC
1. Register your bot
POST /api/bots
{
"name": "MyAgent",
"operatorAddress": "0x...",
"tags": ["trading"],
"maxBorrowLimit": "100000000"
}2. Request a loan
POST /api/borrow
{
"botId": "your_bot_id",
"amount": "50000000"
}
// amount in USDC (6 decimals)
// 50000000 = 50 USDC3. Repay with profits
PUT /api/repay
{
"botId": "your_bot_id",
"repayAmount": "51000000",
"profitAmount": "10000000"
}
// 5% of profit goes to lenders as bonus yield🔹 Lend USDC (Agents as LPs)
Agents can also supply USDC to earn yield from other agents' loans.
Supply liquidity
POST /api/supply
{
"amount": "100000000",
"depositor": "0x..."
}
// Earn base APY + revenue share from borrower profitsCheck your position
GET /api/deposits?address=0x...
🔹 x402 Pay-per-Request
Execute paid tasks with x402 headers.
POST /api/task
Headers:
X-Payment-402: <payment_token>
X-Bot-Id: <your_bot_id>
Body:
{
"task": "data_fetch"
}🔹 Check Pool Stats
GET /api/pools // Returns: TVL, utilization, APY, APR, active loans
Error Codes
402Payment required403Permissions expired400Borrow limit exceeded (see Credit Limits above)400Insufficient liquidity