agentleFS
ahmetenesdurahmetenesdur/starkfi/skills/multi-swap/SKILL.md

multi-swap

Skill2 starsChanged 8 months agoMITView on GitHub

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    BEFORE any multi-swap, you MUST run npx starkfi@latest status and npx starkfi@latest balance to verify connectivity and source token …

    line 29
  2. Very specific:

    Default slippage is 1%. To change, use --slippage <percent>.

    line 33
  3. Very specific:

    AFTER a successful multi-swap, you MUST verify using npx starkfi@latest tx-status <hash>.

    line 35
  4. Very specific:

    Use trade for a single swap (simpler syntax).

    line 96
  5. Very specific:

    Use batch for combining swaps with other operations (stake, supply, send).

    line 97
  6. Very specific:

    Use balance to verify you have enough of all source tokens.

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Multi-Swap

Execute 2-3 independent token swaps in a single Starknet transaction via Fibrous (default). Other providers can be selected with --provider, or use --provider auto to race all providers per pair. All swaps are bundled into one multicall, saving gas compared to executing them individually.

Prerequisites

  • Active session required.
  • Sufficient balance for ALL source tokens + gas fees.

Rules

  1. BEFORE any multi-swap, you MUST run npx starkfi@latest status and npx starkfi@latest balance to verify connectivity and source token balances for ALL pairs.
  2. Minimum 2 and maximum 3 swap pairs per multi-swap. Single swaps should use the trade skill instead.
  3. The pairs string MUST be wrapped in double quotes and each pair separated by a comma.
  4. Each pair follows the format: <amount> <FROM>><TO> (no spaces around >).
  5. Default slippage is 1%. To change, use --slippage <percent>.
  6. Suggest using --simulate first so the user can confirm gas cost.
  7. AFTER a successful multi-swap, you MUST verify using npx starkfi@latest tx-status <hash>.

Commands

npx starkfi@latest multi-swap "<pairs>" [--provider <fibrous|avnu|ekubo|auto>] [--slippage <percent>] [--simulate] [--json]

Parameters

ParameterTypeDescriptionRequired
pairsstringSwap pairs: "100 USDC>ETH, 50 USDT>STRK" (2-3 pairs)Yes
--providerstringProvider: fibrous (default), avnu, ekubo, auto (race all)No
--slippagenumberSlippage tolerance in % (default: 1)No
--simulateflagEstimate fees without broadcastingNo
--jsonflagOutput as JSONNo

Pair Format

"<amount> <FROM>><TO>, <amount> <FROM>><TO>"

Examples:

  • "100 USDC>ETH, 200 USDT>STRK" — two pairs
  • "50 DAI>ETH, 100 USDC>STRK, 0.1 ETH>USDT" — three pairs (maximum)

Examples

User: "Swap 100 USDC to ETH and 200 USDT to STRK in one transaction"

npx starkfi@latest status
npx starkfi@latest balance
npx starkfi@latest multi-swap "100 USDC>ETH, 200 USDT>STRK"
npx starkfi@latest tx-status <hash>

User: "Simulate swapping 50 DAI, 100 USDC, and 0.1 ETH"

npx starkfi@latest multi-swap "50 DAI>ETH, 100 USDC>STRK, 0.1 ETH>USDT" --simulate

Error Handling

ErrorAction
Too few pairsMulti-swap requires at least 2 pairs. Use trade for singles.
Too many pairsMaximum 3 pairs. Split into multiple calls.
No route foundOne or more pairs lack liquidity.
Insufficient balanceCheck balance — user may lack one of the source tokens.
Provider unavailableSpecified provider is invalid. Valid: fibrous, avnu, ekubo.
All providers failedAll providers timed out or errored. Retry later.
Simulation failedOne of the routes is invalid or would revert.
Not authenticatedRun authenticate-wallet skill first.

Related Skills

  • Use trade for a single swap (simpler syntax).
  • Use batch for combining swaps with other operations (stake, supply, send).
  • Use balance to verify you have enough of all source tokens.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.