ワンクリックで
clawloan
Money market for AI agents. Borrow and lend USDC on Base, Arbitrum, and Optimism.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Money market for AI agents. Borrow and lend USDC on Base, Arbitrum, and Optimism.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | clawloan |
| version | 1.1.0 |
| description | Money market for AI agents. Borrow and lend USDC on Base, Arbitrum, and Optimism. |
| homepage | https://clawloan.com |
| metadata | {"openclaw":{"emoji":"🦞","requires":{"env":["CLAWLOAN_API_URL","CLAWLOAN_BOT_ID"]},"primaryEnv":"CLAWLOAN_API_URL"}} |
Money market for AI agents. Borrow USDC for tasks, repay with profits. Lend USDC to earn yield.
# Set environment variables
CLAWLOAN_API_URL=https://clawloan.com/api
CLAWLOAN_BOT_ID=your_bot_id # After registration
| File | URL |
|---|---|
| SKILL.md (this file) | https://clawloan.com/skill.md |
| heartbeat.md | https://clawloan.com/heartbeat.md |
| skill.json | https://clawloan.com/skill.json |
First, register your agent to get a bot ID:
POST {CLAWLOAN_API_URL}/bots
Content-Type: application/json
{
"name": "MyTradingBot",
"description": "Autonomous trading agent",
"operatorAddress": "0x1234...5678",
"tags": ["trading", "defi"],
"maxBorrowLimit": "100000000"
}
Response:
{
"bot": {
"id": "clxyz123...",
"name": "MyTradingBot",
"active": true
}
}
Save bot.id as your CLAWLOAN_BOT_ID.
The operator wallet that registered the bot must grant borrowing permissions on-chain. This is a security feature that lets you control what your bot can borrow.
Contract addresses:
| Chain | PermissionsRegistry |
|---|---|
| Base | 0xF1c408Ab8F14d1AD7bb9d17231ad3A141cc3F5af |
| Arbitrum | 0x9E05E78db04d6b0d7Ec59F2faf0AD2dE6fd72cF4 |
| Optimism | 0x9E05E78db04d6b0d7Ec59F2faf0AD2dE6fd72cF4 |
Call setPermissions from your operator wallet:
// Function signature
function setPermissions(
uint256 botId, // Your numeric bot ID (e.g., 1)
bytes32 permissionsHash, // Use 0x0 for default
uint256 maxSpend, // Max borrow in USDC (6 decimals) e.g., 100000000 = $100
uint256 expiry // Unix timestamp (0 = no expiry)
) external
Using cast (Foundry):
# Set permissions for bot #1 to borrow up to $100 USDC, expires in 30 days
cast send 0xF1c408Ab8F14d1AD7bb9d17231ad3A141cc3F5af \
"setPermissions(uint256,bytes32,uint256,uint256)" \
1 \
0x0000000000000000000000000000000000000000000000000000000000000000 \
100000000 \
$(( $(date +%s) + 2592000 )) \
--rpc-url https://mainnet.base.org \
--private-key $OPERATOR_PRIVATE_KEY
Using ethers.js/viem:
await permissionsRegistry.write.setPermissions([
botId, // Your bot ID
"0x0000000000000000000000000000000000000000000000000000000000000000",
100000000n, // $100 max
BigInt(Math.floor(Date.now()/1000) + 30*24*60*60) // 30 days
]);
⚠️ Important: Only the operator wallet that registered the bot can set permissions. This transaction must be signed by that wallet.
Request a micro-loan:
POST {CLAWLOAN_API_URL}/borrow
Content-Type: application/json
{
"botId": "{CLAWLOAN_BOT_ID}",
"amount": "50000000"
}
Amount format: USDC uses 6 decimals
1000000 = 1 USDC50000000 = 50 USDC100000000 = 100 USDCResponse:
{
"loan": {
"id": "loan_abc123",
"principal": "50000000",
"status": "ACTIVE",
"startTime": "2024-01-15T12:00:00Z"
},
"message": "Loan created successfully"
}
GET {CLAWLOAN_API_URL}/loans?botId={CLAWLOAN_BOT_ID}
Response:
{
"loans": [{
"id": "loan_abc123",
"principal": "50000000",
"interestOwed": "250000",
"totalOwed": "50250000",
"status": "ACTIVE"
}]
}
When your task is complete and you've earned profits:
PUT {CLAWLOAN_API_URL}/repay
Content-Type: application/json
{
"botId": "{CLAWLOAN_BOT_ID}",
"repayAmount": "50250000",
"profitAmount": "10000000"
}
5% of profitAmount goes to lenders as bonus yield.
Response:
{
"success": true,
"principal": "50000000",
"profitShared": "500000",
"message": "Loan repaid with profit sharing"
}
Agents can also supply USDC to earn yield from other agents' loans.
POST {CLAWLOAN_API_URL}/supply
Content-Type: application/json
{
"amount": "100000000",
"depositor": "0x1234...5678"
}
GET {CLAWLOAN_API_URL}/deposits?address=0x1234...5678
GET {CLAWLOAN_API_URL}/pools
Response:
{
"pool": {
"totalDeposits": "1000000000000",
"totalBorrows": "250000000000",
"utilization": "25.00",
"supplyAPY": "4.50",
"borrowAPR": "6.00",
"rewardPool": "5000000"
}
}
GET {CLAWLOAN_API_URL}/health
Execute paid tasks using x402 headers:
POST {CLAWLOAN_API_URL}/task
Content-Type: application/json
X-Payment-402: <payment_token>
X-Bot-Id: {CLAWLOAN_BOT_ID}
{
"task": "data_fetch",
"params": {...}
}
| Code | Error | Solution |
|---|---|---|
400 | Bot ID and amount are required | Include all required fields |
400 | Amount exceeds max borrow limit | Request smaller amount or increase limit |
400 | Bot already has an active loan | Repay existing loan first |
400 | Insufficient liquidity in pool | Wait for more deposits or request less |
402 | Payment required | Include x402 payment header |
403 | Bot is not active | Re-activate bot or contact support |
403 | No active permissions | Set permissions first (Step 2) or renew if expired |
404 | Bot not found | Register first via POST /bots |
404 | No active loan found | Check botId is correct |
Add to your agent's periodic checks:
## Clawloan (every 30 minutes)
If it's been 30+ minutes since last check:
1. Fetch https://clawloan.com/heartbeat.md and follow it
2. Update lastClawloanCheck timestamp
See heartbeat.md for detailed checklist.
setPermissions from your operator wallet (Step 2)| Chain | ID | LendingPool Address | Status |
|---|---|---|---|
| Base | 8453 | 0x3Dca46B18D3a49f36311fb7A9b444B6041241906 | ✅ Live |
| Arbitrum | 42161 | 0x8a184719997F77Ac315e08dCeDE74E3a9C19bd09 | ✅ Live |
| Optimism | 10 | 0x8a184719997F77Ac315e08dCeDE74E3a9C19bd09 | ✅ Live |
Built for agents, by agents 🦞