Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing.

Apache-2.0Auto-check: notesBusiness, Finance & HR

Install Starknet Defi

skills CLI
$ npx skills add internet-court/internet-court-skill --skill starknet-defi -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install internet-court/internet-court-skill starknet-defi --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/internet-court/internet-court-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/vendored/starknet/starknet-defi .claude/skills/starknet-defi && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
starknet-defi
GitHub stars
6.6k
Used in
1 other repo
Token cost
~2.3k tokens
SKILL.md length
254 words
Files
3
Skills in repo
80
Repo updated
First seen
Licence
Apache-2.0

At a glance

Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing.

  • Works in 2 steps: Install the AVNU + starknet.js… → Use skills catalog when the flow expands…
  • Tasks that involve Crypto and DeFi analysis
  • SKILL.md covers When to Use, When NOT to Use, Quick Start and Prerequisites, plus 8 more sections
  • Calls npm; reaches starknet.paymaster.avnu.fi and starknet.api.avnu.fi; needs STARKNET_PRIVATE_KEY and AVNU_API_KEY

What it does

Starknet Defi is an agent skill from internet-court/internet-court-skill. Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing. Supports gasless transactions.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `agents/openai.yaml`).

It sits in Business, Finance & HR, covering Crypto and DeFi analysis and Banking and insurance. The repository describes itself as: The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Crypto and DeFi analysis
  • Tasks that involve Banking and insurance

Example prompts

  • “/starknet-defi”

Requirements

  • Node.js
  • A credential in STARKNET_PRIVATE_KEY
  • A credential in AVNU_API_KEY
  • Pre-approved tools (allowed-tools): Bash, Read, Write, Glob, Grep, Task

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Install the AVNU + starknet.js dependencies and point the skill at a funded Starknet account.
  2. Use skills catalog when the flow expands into wallet setup, deployment, or auditing.

What it can do on your machine

Read from SKILL.md and the folder at commit fa89195. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Write
    • Glob
    • Grep
    • Task

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • starknet.paymaster.avnu.fi
    • starknet.api.avnu.fi
    • sepolia.paymaster.avnu.fi
    • sepolia.api.avnu.fi

    Also links to:

    • docs.avnu.fi
    • github.com
    • docs.ekubo.org
    • docs.zklend.com
    • docs.nostra.finance

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • STARKNET_PRIVATE_KEY
    • AVNU_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Starknet Defi loads about 2.3k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 254 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Write, Glob, Grep, Task

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from internet-court/internet-court-skill at commit fa89195, republished under its Apache-2.0 licence (© internet-court). 254 words, ~2,348 tokens.

Download SKILL.mdSave it as .claude/skills/starknet-defi/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
starknet-defi
description
Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing. Supports gasless transactions.
allowed-tools
Bash, Read, Write, Glob, Grep, Task
license
Apache-2.0
metadata.author
starknet-agentic
metadata.version
1.0.0
metadata.org
keep-starknet-strange
keywords
starknet, defi, swap, dca, staking, lending, avnu, ekubo, jediswap, zklend, nostra, aggregator, yield
user-invocable
true

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

  1. Install the AVNU + starknet.js dependencies and point the skill at a funded Starknet account.
  2. Use skills catalog when the flow expands into wallet setup, deployment, or auditing.

Prerequisites

bash
npm install starknet@^8.9.1 @avnu/avnu-sdk@^4.0.1

Token Swaps (avnu SDK v4)

Get Quote and Execute Swap
typescript
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 object
const 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 directly
const 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 param
const result = await executeSwap({
  provider: account,
  quote: bestQuote,
  slippage: 0.01, // 1%
  executeApprove: true,
});
console.log("Tx:", result.transactionHash);
Quote Response Fields (SDK v4)
typescript
interface Quote {
  quoteId: string;
  sellTokenAddress: string;
  buyTokenAddress: string;
  sellAmount: bigint;
  buyAmount: bigint;
  sellAmountInUsd: number;
  buyAmountInUsd: number;
  priceImpact: number;        // In basis points (15 = 0.15%)
  gasFeesInUsd: number;
  routes: Array<{
    name: string;             // e.g., "Ekubo", "JediSwap"
    percent: number;          // e.g., 0.8 = 80%
  }>;
  fee: {
    avnuFees: bigint;
    integratorFees: bigint;
  };
}
Build Swap Calls (for multicall composition)
typescript
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
typescript
import { getQuotes, executeSwap } from "@avnu/avnu-sdk";
import { PaymasterRpc } from "starknet";

const quotes = await getQuotes(quoteParams);
const bestQuote = quotes[0];

// SDK v4: Use PaymasterRpc from starknet.js
// Mainnet: https://starknet.paymaster.avnu.fi
// Sepolia: https://sepolia.paymaster.avnu.fi
const paymaster = new PaymasterRpc({
  nodeUrl: process.env.AVNU_PAYMASTER_URL || "https://starknet.paymaster.avnu.fi",
});

const result = await executeSwap({
  provider: account,
  quote: bestQuote,
  slippage: 0.01,
  executeApprove: true,
  paymaster: {
    active: true,
    provider: paymaster,
    params: {
      feeMode: {
        mode: "default",
        gasToken: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", // USDC
      },
    },
  },
});

DCA (Dollar Cost Averaging)

Create DCA Order
typescript
import { executeCreateDca } from "@avnu/avnu-sdk";
import moment from "moment";

const dcaOrder = {
  sellTokenAddress: usdcAddress,
  buyTokenAddress: strkAddress,
  totalAmount: parseUnits("100", 6),   // Total 100 USDC
  numberOfOrders: 10,                   // Split into 10 orders
  frequency: moment.duration(1, "day"), // moment.Duration object, not string
  startAt: Math.floor(Date.now() / 1000),
};

const result = await executeCreateDca({
  provider: account,
  order: dcaOrder,
});
Check and Cancel DCA
typescript
import { getDcaOrders, executeCancelDca, DcaOrderStatus } from "@avnu/avnu-sdk";

const orders = await getDcaOrders({
  traderAddress: account.address,
  status: DcaOrderStatus.OPEN,  // Use enum, not string
});

// Cancel an order
await executeCancelDca({
  provider: account,
  orderAddress: orders[0].orderAddress,
});

STRK Staking

Stake STRK
typescript
import { executeStake, getAvnuStakingInfo } from "@avnu/avnu-sdk";

// Get pool info
const stakingInfo = await getAvnuStakingInfo();
// stakingInfo.pools[0] = { address, apy, tvl, token, minStake }

const result = await executeStake({
  provider: account,
  poolAddress: stakingInfo.pools[0].address,
  amount: parseUnits("100", 18), // 100 STRK
});
Get User Staking Info
typescript
import { getUserStakingInfo } from "@avnu/avnu-sdk";

const userInfo = await getUserStakingInfo(TOKENS.STRK, account.address);
console.log("Staked:", userInfo.amount);
console.log("Unclaimed rewards:", userInfo.unclaimedRewards);
Claim Rewards
typescript
import { executeClaimRewards } from "@avnu/avnu-sdk";

// Claim and restake (compound)
await executeClaimRewards({
  provider: account,
  poolAddress: poolAddress,
  restake: true,
});
Unstake
typescript
import { executeInitiateUnstake, executeUnstake } from "@avnu/avnu-sdk";

// Step 1: Initiate (starts cooldown -- 21 days for STRK)
await executeInitiateUnstake({
  provider: account,
  poolAddress: poolAddress,
  amount: parseUnits("50", 18),
});

// Step 2: Complete unstake (after cooldown period)
await executeUnstake({
  provider: account,
  poolAddress: poolAddress,
});

Market Data

Token Prices
typescript
import { getPrices, fetchTokens, fetchVerifiedTokenBySymbol } from "@avnu/avnu-sdk";

// Get token by symbol
const strk = await fetchVerifiedTokenBySymbol("STRK");

// Get prices for multiple tokens
const prices = await getPrices([ethAddress, strkAddress, usdcAddress]);
// prices = { "0x049d...": 3200.50, "0x047...": 1.23, ... }

// Browse tokens with pagination
const tokens = await fetchTokens({ page: 0, size: 20, tags: ["verified"] });

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

Configuration

VariablePurposeDefault
STARKNET_RPC_URLStarknet JSON-RPC endpointRequired
STARKNET_ACCOUNT_ADDRESSAgent's account addressRequired
STARKNET_PRIVATE_KEYAgent's signing keyRequired
AVNU_BASE_URLavnu API base URLhttps://starknet.api.avnu.fi
AVNU_PAYMASTER_URLavnu paymaster URLhttps://starknet.paymaster.avnu.fi
AVNU_API_KEYOptional avnu integrator keyNone
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

typescript
async function safeSwap(account, quote, slippage = 0.01) {
  try {
    return await executeSwap({
      provider: account,
      quote,
      slippage,
      executeApprove: true,
    });
  } catch (error) {
    if (error.message?.includes("INSUFFICIENT_BALANCE")) {
      throw new Error("Not enough tokens for swap");
    }
    if (error.message?.includes("SLIPPAGE") || error.message?.includes("Insufficient tokens received")) {
      // Retry with higher slippage
      return await executeSwap({
        provider: account,
        quote,
        slippage: slippage * 2,
        executeApprove: true,
      });
    }
    if (error.message?.includes("QUOTE_EXPIRED")) {
      throw new Error("Quote expired. Please retry the operation.");
    }
    if (error.message?.includes("INSUFFICIENT_LIQUIDITY")) {
      throw new Error("Insufficient liquidity. Try a smaller amount.");
    }
    throw error;
  }
}

References

© internet-court, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in vendored/starknet/starknet-defi of internet-court/internet-court-skill.

  • SKILL.md
  • LICENSE
  • agents/openai.yaml

Open the folder on GitHubat commit fa89195

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in internet-court/internet-court-skill, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Starknet Defi next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Starknet Defi compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Starknet Defi this skillinternet-court/internet-court-skill6.6k1 repos~2.3kAutomated safety check: NotesApache-2.0
Swapper Depositswapperfinance/swapper-toolkit852—~1.8kAutomated safety check: PassMIT
Okx Cex Earnokx/agent-skills1872 repos~3.3kAutomated safety check: PassMIT
Oracle Flashloan Analysisquillai-network/quillshield_skills130—~2.8kAutomated safety check: PassMIT
Defi ConnectorSignal-Execution-Labs/forex-trading-ai-agent162—~2.4kAutomated safety check: PassMIT
Fixed Incomeagiprolabs/claude-trading-skills410—~1.6kAutomated safety check: PassMIT

Similar skills

  • Swapper Deposit

    swapperfinance/swapper-toolkit

    Deposit and bridge funds into a wallet or protocol using Swapper Finance.

    852 GitHub stars~1.8k tokensUpdated 6 mo ago
    Business, Finance & HRAuto-check passed
  • Okx Cex Earn

    okx/agent-skills

    Manages OKX Simple Earn (flexible savings/lending), Flash Earn, On-chain Earn (staking/DeFi), Dual Investment (DCD/双币赢), and AutoEarn (自动赚币) via the okx CLI.

    187 GitHub starsUsed in 2 repos~3.3k tokens
    Business, Finance & HRAuto-check passed
  • Oracle Flashloan Analysis

    quillai-network/quillshield_skills

    Detects price oracle manipulation and flash loan attack vectors in DeFi smart contracts.

    130 GitHub stars~2.8k tokensUpdated 6 mo ago
    Business, Finance & HRAuto-check passed
  • Defi Connector

    Signal-Execution-Labs/forex-trading-ai-agent

    Connect to DeFi protocols for staking, lending, yield farming, and liquidity provision.

    162 GitHub stars~2.4k tokensUpdated 27 days ago
    Business, Finance & HRAuto-check passed
  • Fixed Income

    agiprolabs/claude-trading-skills

    [STUB] Bond pricing, yield curves, duration and convexity analysis, and DeFi lending rate modeling

    410 GitHub stars~1.6k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Lifi

    aiskillstore/marketplace

    Use the LI.FI REST API for cross-chain and same-chain token swaps, bridging, DeFi deposits through Composer, yield discovery and position tracking through Earn, and solver-based Intents.

    433 GitHub starsUsed in 1 repo~5k tokens
    Business, Finance & HRAuto-check passed

More from internet-court/internet-court-skill

All 80 skills in this repo
  • Kleros IPFS Upload

    internet-court/internet-court-skill

    Uploads one Kleros-related file per paid request to IPFS through the Kleros x402 gateway for 0.01 USDC on Base, returning a CID that Kleros contracts can reference.

    6.6k GitHub stars~4.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • 0G Compute Network Guide

    internet-court/internet-court-skill

    Guides building on the 0G Compute Network, a decentralized GPU marketplace for AI inference and fine-tuning, with SDK patterns and CLI commands.

    6.6k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • PNP Prediction Markets on Solana

    internet-court/internet-court-skill

    Creates, trades and settles permissionless prediction markets on Solana with any SPL token as collateral, including social-media and custom-oracle markets.

    6.6k GitHub stars~7.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • BNB Chain MCP Server

    internet-court/internet-court-skill

    Connects an agent to the BNB Chain MCP server to read blocks and contracts, move tokens and NFTs, register ERC-8004 agents and use Greenfield storage.

    6.6k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • GenLayer ERC-7710 Connector

    internet-court/internet-court-skill

    Specifies how a GenLayer Intelligent Contract decision about an agent's performance becomes an ERC-7710 revocation or policy change, through a relayer or bridge and an EVM controller.

    6.6k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • GenLayer Agent Supervision Adapter

    internet-court/internet-court-skill

    Specifies how a GenLayer Intelligent Contract should supervise an AI agent, with review rubrics, evidence schemas and continue, warn, constrain or revoke decisions.

    6.6k GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed

Questions about Starknet Defi

What does Starknet Defi do?

Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing. Starknet Defi is an agent skill from internet-court/internet-court-skill. Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing.

When should I use Starknet Defi?

Starknet Defi fits situations like: tasks that involve Crypto and DeFi analysis; tasks that involve Banking and insurance.

How do I install Starknet Defi in Claude Code?

Run `npx skills add internet-court/internet-court-skill --skill starknet-defi -a claude-code`. Or copy the skill folder (vendored/starknet/starknet-defi in internet-court/internet-court-skill) into .claude/skills/starknet-defi in your project. Claude Code loads it when a task matches its description.

How do I install Starknet Defi in Codex?

Run `npx skills add internet-court/internet-court-skill --skill starknet-defi -a codex`. Or copy the skill folder (vendored/starknet/starknet-defi in internet-court/internet-court-skill) into .agents/skills/starknet-defi in your project. Codex loads it when a task matches its description.

Can I use Starknet Defi in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add internet-court/internet-court-skill --skill starknet-defi -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/starknet-defi, .gemini/skills/starknet-defi, .github/skills/starknet-defi and .opencode/skills/starknet-defi in your project.

What does Starknet Defi need to run?

Going by SKILL.md and its folder, Starknet Defi needs the command-line tools its instructions call (npm) and credentials named STARKNET_PRIVATE_KEY and AVNU_API_KEY. Our summary lists: Node.js; A credential in STARKNET_PRIVATE_KEY; A credential in AVNU_API_KEY. Its frontmatter pre-approves these tools: Bash, Read, Write, Glob, Grep, Task.

Does Starknet Defi access the network?

SKILL.md names 9 domains. In commands or code: starknet.paymaster.avnu.fi, starknet.api.avnu.fi, sepolia.paymaster.avnu.fi and sepolia.api.avnu.fi; the agent is likely to contact these when it follows the instructions. As links in the text: docs.avnu.fi, github.com, docs.ekubo.org, docs.zklend.com and docs.nostra.finance. This is read from the text; nothing was executed.

Is Starknet Defi safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Starknet Defi use?

Starknet Defi is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Starknet Defi use?

About 2.3k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Starknet Defi?

Skills that share tags, products or a category with Starknet Defi: Swapper Deposit (swapperfinance/swapper-toolkit, 852 stars), Okx Cex Earn (okx/agent-skills, 187 stars), Oracle Flashloan Analysis (quillai-network/quillshield_skills, 130 stars) and Defi Connector (Signal-Execution-Labs/forex-trading-ai-agent, 162 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Starknet Defi?

internet-court (a GitHub organization) maintains it in internet-court/internet-court-skill, which has 6,551 GitHub stars. The repository holds 80 skills in this directory. The repository was last updated on August 19, 2026.

Source: internet-court/internet-court-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.