DeFi Skill
The starknet-defi skill enables AI agents to execute DeFi operations on Starknet using the AVNU aggregator. Swap tokens with best-price routing, set up DCA orders, stake STRK, and interact with lending protocols.
Installation
# Install via skills CLI
npx skills add keep-starknet-strange/starknet-agentic/skills/starknet-defi
# Or clone the repo
git clone https://github.com/keep-starknet-strange/starknet-agentic.gitBest Price Routing
AVNU aggregates liquidity across all Starknet DEXs (Ekubo, JediSwap, etc.) to find the optimal route for every swap.
Example Usages
MCP Tools
| Tool | Purpose |
|---|---|
starknet_swap | Execute token swap via AVNU |
starknet_get_quote | Get swap quote without executing |
Protocol Reference
| Protocol | Operations | Notes |
|---|---|---|
| AVNU | Swap aggregation, DCA, gasless | Best-price routing across all DEXs |
| Ekubo | AMM, concentrated liquidity | Highest TVL on Starknet |
| JediSwap | AMM, classic pools | V2 with concentrated liquidity |
| zkLend | Lending, borrowing | Variable and stable rates |
| Nostra | Lending, borrowing | Multi-asset pools |
AVNU URL Reference
| Network | API URL | Paymaster URL |
|---|---|---|
| Mainnet | https://starknet.api.avnu.fi | https://starknet.paymaster.avnu.fi |
| Sepolia | https://sepolia.api.avnu.fi | https://sepolia.paymaster.avnu.fi |
Error Handling
| Error | Cause | Resolution |
|---|---|---|
INSUFFICIENT_BALANCE | Not enough tokens | Check balance before swap |
SLIPPAGE_EXCEEDED | Price moved too much | Retry with higher slippage |
QUOTE_EXPIRED | Quote too old | Get fresh quote |
NO_ROUTES_FOUND | Can't find swap path | Try different token pair or smaller amount |