| name | solana-defi-agent |
| description | DeFi toolkit for AI agents on Solana — swaps, lending, staking via Solana Actions/Blinks |
Solana DeFi Agent Skill
DeFi toolkit for AI agents on Solana — swaps, lending, staking, and more
New here? → Start with QUICKSTART.md for a 10-minute setup guide.
What This Does
Solana Blinks (Blockchain Links) let you execute DeFi operations—swaps, deposits, staking—through simple URLs. This skill gives you:
- CLI for quick operations:
blinks execute <url> --amount=100
- SDK for building automations
- Registry access to 900+ trusted protocol endpoints
blinks execute "https://kamino.dial.to/api/v0/lend/usdc-prime/deposit" --amount=100
⚠️ Before You Start
Required
Environment Variables
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_WALLET_PATH=~/.config/solana/my-wallet.json
🔒 Security
- Never commit keypairs to git - use
.env and .gitignore
- Test with small amounts first - mistakes happen
- Verify hosts are trusted - CLI warns about untrusted hosts
- Use a dedicated wallet - not your main holdings
Protocol Status (Updated 2026-02-02)
✅ Working
| Protocol | Actions | Endpoint |
|---|
| Jupiter | Swap any tokens | worker.jup.ag |
| Raydium | Swap, LP | share.raydium.io |
| Kamino | Deposit, withdraw, borrow, repay | kamino.dial.to |
| Jito | Stake SOL | jito.network, jito.dial.to |
| Tensor | Buy floor, bid on NFTs | tensor.dial.to |
| Drift | Vault deposit/withdraw | app.drift.trade |
🔑 Needs API Key
| Protocol | Get Key | Notes |
|---|
| Lulo | dev.lulo.fi | 24hr withdrawal cooldown |
❌ Currently Broken
| Protocol | Issue | Workaround |
|---|
| Orca | No public blink API | Use Jupiter or Raydium |
| Sanctum | Cloudflare blocks server IPs | Use their web UI |
| Some dial.to | Rate limiting | Try self-hosted endpoints |
❓ Untested
MarginFi, Meteora, Helius, Magic Eden - endpoints exist but need verification.
Quick Reference
Inspect Before Executing
Always preview what a blink does:
blinks inspect <url>
Shows metadata, available actions, and trust status.
Execute Transactions
blinks execute <url> --amount=100 --dry-run
blinks execute <url> --amount=100
Protocol-Specific Commands
blinks kamino deposit --vault=usdc-prime --amount=100
blinks kamino withdraw --vault=usdc-prime --amount=50
blinks jito stake --amount=1
blinks execute "https://..." --amount=X
SDK Usage
import {
ActionsClient,
BlinksExecutor,
Wallet,
getConnection,
isHostTrusted,
} from '@openclaw/solana-defi-agent-skill';
const connection = getConnection();
const wallet = Wallet.fromEnv();
const actions = new ActionsClient();
const executor = new BlinksExecutor(connection);
const trusted = await isHostTrusted('https://kamino.dial.to');
if (!trusted) throw new Error('Untrusted host!');
const metadata = await actions.getAction(
'https://kamino.dial.to/api/v0/lend/usdc-prime/deposit'
);
console.log('Available actions:', metadata.links.actions);
const tx = await actions.postAction(
'https://kamino.dial.to/api/v0/lend/usdc-prime/deposit?amount=100',
wallet.address
);
const sim = await executor.(tx);
(!sim.) {
();
}
signature = executor.(tx, wallet.());
.(, );
How Blinks Work
- GET request to action URL → Returns metadata + available actions
- POST request with wallet address → Returns transaction to sign
- Sign transaction locally and submit to Solana
User → GET blink URL → Protocol returns actions
User → POST with wallet → Protocol returns transaction
User → Sign & submit → Transaction confirmed
The skill handles all of this. You just provide the URL and amount.
Troubleshooting
| Error | Cause | Fix |
|---|
422 Unprocessable Entity | Missing required tokens | Check token balance before deposit |
403 Forbidden | Cloudflare blocking | Try protocol's self-hosted endpoint |
Transaction simulation failed | Insufficient SOL or stale tx | Check balance, retry quickly |
Rate limit exceeded | Public RPC overloaded | Use Helius/QuickNode free tier |
Untrusted host warning | Host not in Dialect registry | Verify URL is correct |
Blink URL Formats
The CLI accepts multiple formats:
blinks inspect "https://kamino.dial.to/api/v0/lend/usdc/deposit"
blinks inspect "solana-action:https://kamino.dial.to/..."
blinks inspect "https://dial.to/?action=solana-action:https://..."
RPC Recommendations
Public works for testing but will hit rate limits in production.
Files
solana-defi-agent-skill/
├── SKILL.md # This file
├── QUICKSTART.md # Beginner setup guide
├── README.md # Package readme
├── .env.example # Environment template
├── src/ # Source code
├── dist/ # Built CLI + SDK
├── docs/ # Protocol status, specs
└── tests/ # Protocol endpoint tests
Links