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.git

Best Price Routing

AVNU aggregates liquidity across all Starknet DEXs (Ekubo, JediSwap, etc.) to find the optimal route for every swap.

Example Usages

MCP Tools

ToolPurpose
starknet_swapExecute token swap via AVNU
starknet_get_quoteGet swap quote without executing

Protocol Reference

ProtocolOperationsNotes
AVNUSwap aggregation, DCA, gaslessBest-price routing across all DEXs
EkuboAMM, concentrated liquidityHighest TVL on Starknet
JediSwapAMM, classic poolsV2 with concentrated liquidity
zkLendLending, borrowingVariable and stable rates
NostraLending, borrowingMulti-asset pools

AVNU URL Reference

NetworkAPI URLPaymaster URL
Mainnethttps://starknet.api.avnu.fihttps://starknet.paymaster.avnu.fi
Sepoliahttps://sepolia.api.avnu.fihttps://sepolia.paymaster.avnu.fi

Error Handling

ErrorCauseResolution
INSUFFICIENT_BALANCENot enough tokensCheck balance before swap
SLIPPAGE_EXCEEDEDPrice moved too muchRetry with higher slippage
QUOTE_EXPIREDQuote too oldGet fresh quote
NO_ROUTES_FOUNDCan't find swap pathTry different token pair or smaller amount

References