---
slug: "avnu-skill"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/avnu-labs/avnu-skill@main/README.md"
repo: "https://github.com/avnu-labs/avnu-skill"
source_file: "README.md"
branch: "main"
---
# avnu Skill for Claude Code

A Claude Code skill that provides AI agents with knowledge of the [avnu SDK](https://github.com/avnu-labs/avnu-sdk) for building DeFi applications on Starknet.

## What is this?

This skill teaches Claude Code how to integrate with avnu's DeFi infrastructure on Starknet:

- **Token Swaps** - Best-price routing across multiple DEXs
- **DCA Orders** - Dollar Cost Averaging with automated recurring buys
- **Staking** - Native STRK and BTC variant staking
- **Gasless Transactions** - Users pay fees in ERC-20 tokens via Paymaster
- **Gasfree Transactions** - dApp sponsors gas fees on behalf of users
- **Market Data** - Prices, volumes, TVL from Impulse API

## Installation

```bash
npx skills add avnu-labs/avnu-skill
```

## Usage

Once installed, Claude Code automatically uses this skill when you ask about:

- Building swaps on Starknet
- Integrating avnu SDK
- DCA strategies
- Gasless/gasfree transactions
- Starknet DeFi

### Example Prompts

```
"Help me build a swap from ETH to USDC using avnu"
"Create a DCA order to buy ETH weekly"
"How do I enable gasless transactions with the paymaster?"
"Sponsor gas fees for my users with gasfree mode"
"Set up STRK staking with avnu"
```

## Skill Contents

```
skills/avnu/
├── SKILL.md                    # Main skill file with quick reference
├── references/
│   ├── swap-guide.md           # Detailed swap documentation
│   ├── dca-guide.md            # DCA order management
│   ├── staking-guide.md        # Staking operations
│   ├── paymaster-guide.md      # Gasless & gasfree transactions
│   ├── gasfree-frontend.md     # Frontend patterns for sponsored txs
│   ├── tokens-prices.md        # Token & price APIs
│   ├── error-handling.md       # Error taxonomy
│   └── configuration.md        # SDK configuration
└── scripts/
    ├── swap-example.ts         # Runnable swap example
    ├── dca-example.ts          # Runnable DCA example
    ├── staking-example.ts      # Runnable staking example
    ├── gasless-swap.ts         # Runnable gasless example
    └── gasfree-swap.ts         # Runnable gasfree (sponsored) example
```

## Requirements

The skill assumes projects use:

- `@avnu/avnu-sdk` - avnu SDK
- `starknet` - Starknet.js v6+
- `ethers` - Token amount formatting (formatUnits/parseUnits)
- `moment` - Date formatting (DCA examples only)

### Gasfree Mode (Optional)

To sponsor gas fees for your users, you need an API key from [portal.avnu.fi](https://portal.avnu.fi):

1. Connect with your Starknet wallet
2. Create a new API key
3. Fund your key with STRK on mainnet (free on Sepolia)
4. Add to your `.env` file (server-side only):

```bash
AVNU_PAYMASTER_API_KEY=your-api-key-here
```

> ⚠️ Never expose this key in frontend code. Use Server Actions or API routes.

## Links

- [avnu Documentation](https://docs.avnu.fi)
- [avnu SDK](https://github.com/avnu-labs/avnu-sdk)
- [avnu App](https://app.avnu.fi)
- [avnu Portal](https://portal.avnu.fi) - API keys for gasfree mode
- [Starknet.js](https://www.starknetjs.com/)

## License

MIT
