Answers from the documentation; checking which model is on duty
Hi - I answer from the OpenSmartRoute documentation: routing, the API, plans and quotas, self-hosting. Ask away, or open a support ticket if you need a person.
Grounded in the docs - follow a source before acting on it.
starknet-defi - Skill - OpenSmartRoute
Skillv1.0.0
starknet-defi
Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing. Supports gasless transactions.
Imported from aiskillstore/marketplace (skills/internet-court/starknet-defi/SKILL.md). Install upstream with npx skills add aiskillstore/marketplace --skill starknet-defi. Copyright stays with the author (Apache-2.0).
Starknet DeFi Skill
Execute DeFi operations on Starknet using avnu aggregator and native protocols.
When to Use
Swaps, DCA orders, staking, and lending or borrowing flows on Starknet.
Agent workflows that need AVNU routing, paymaster support, or protocol-specific DeFi execution.
When NOT to Use
Plain wallet management without DeFi intent.
Cairo contract authoring, deployment operations, or security auditing.
Quick Start
Install the AVNU + starknet.js dependencies and point the skill at a funded Starknet account.
Use skills catalog when the flow expands into wallet setup, deployment, or auditing.
Prerequisites
npm install starknet@^8.9.1 @avnu/avnu-sdk@^4.0.1
Token Swaps (avnu SDK v4)
Get Quote and Execute Swap
import { getQuotes, executeSwap, type QuoteRequest } from "@avnu/avnu-sdk";import { Account, RpcProvider, ETransactionVersion } from "starknet";const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });// starknet.js v8: Account uses options objectconst account = new Account({ provider, address, signer: privateKey, transactionVersion: ETransactionVersion.V3,});// Resolve token addresses via avnu SDK (or use MCP server's TokenService)import { fetchVerifiedTokenBySymbol } from '@avnu/avnu-sdk';const eth = await fetchVerifiedTokenBySymbol('ETH');const strk = await fetchVerifiedTokenBySymbol('STRK');// SDK v4: getQuotes takes QuoteRequest object directlyconst quoteParams: QuoteRequest = { sellTokenAddress: eth.address, buyTokenAddress: strk.address, sellAmount: BigInt(10 ** 17), // 0.1 ETH takerAddress: account.address,};const quotes = await getQuotes(quoteParams);const bestQuote = quotes[0];// SDK v4: executeSwap takes single object paramconst result = await executeSwap({ provider: account, quote: bestQuote, slippage: 0.01, // 1% executeApprove: true,});console.log("Tx:", result.transactionHash);
import { quoteToCalls } from "@avnu/avnu-sdk";const calls = await quoteToCalls({ quote: bestQuote, takerAddress: account.address, slippage: 0.01, includeApprove: true,});// `calls` can be combined with other calls in account.execute([...calls, ...otherCalls])
Gasless Swap (Pay Gas in Token) - SDK v4 + PaymasterRpc
Install starknet-defi and it becomes one more candidate the router can pick - when it fits.
A listing is a routing target with a manifest: what it does, which domains it covers, what it costs and who publishes it. Once installed it sits beside your own models and tools, is scored like any other candidate for each request, and shows up in the trace when it wins. Ratings come from workspaces that installed it, one per account.
When a provider is down or over quota the request moves on; the trace says it did.
Use it
Copy one of these into your project. Installing also returns the manifest and these snippets.
# after Install: the listing is in your workspace's routing pool - a plan picks it for its slotcurl-s-X POST https://api.opensmartroute.ai/api/v1/route -H 'Authorization: Bearer $OSR_API_KEY' -H 'Content-Type: application/json' -d '{"text": "...", "plan": true}'
Manifest
An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.