Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

swap-build

БесплатноБез исполняемых скриптовНе проверен

This skill should be used when the user asks to "swap-build", "build a swap transaction", "build swap calldata", "create swap tx", "swap tokens", "trade…

jiayaoqijiaот jiayaoqijia★ 81 звезда на GitHub

Об этом скилле

KyberSwap Build Skill

Build swap transactions using the KyberSwap Aggregator. Given a token pair, amount, and sender address, fetch the best route and generate encoded calldata ready for on-chain submission.

This is a three-step process:

  1. GET the optimal route (same as the quote skill)
  2. Show quote details and ask for user confirmation
  3. POST to build the encoded transaction calldata

Input Parsing

The user will provide input like:

  • 100 USDC to ETH on arbitrum from 0xAbc123...
  • 1 ETH to USDC on ethereum from 0xAbc123... slippage 100
  • 0.5 WBTC to DAI on polygon from 0xAbc123... to 0xDef456...

Extract these fields:

  • amount — the human-readable amount to swap
  • tokenIn — the input token symbol
  • tokenOut — the output token symbol
  • chain — the chain slug (default: ethereum)
  • sender — the address that will send the transaction (required)
  • recipient — the address to receive output tokens (default: same as sender). WARNING: When the recipient address differs from the sender, display a prominent warning: "Output tokens will be sent to a DIFFERENT address than the sender. Please verify the recipient address carefully."
  • slippageTolerance — slippage in basis points (see Slippage Defaults below)

If the sender address is not provided, ask the user for it before proceeding. Do not guess or use a placeholder address.

Sender address validation — reject or warn before proceeding:

  • Must not be the zero address (0x0000000000000000000000000000000000000000) — this is an invalid sender and the transaction will fail.
  • Must not be the native token sentinel (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) — this is a placeholder for native tokens, not a real account.
  • Warn if it matches a known contract address (e.g., a token address or the router address) — sending from a contract address is unusual and likely a mistake. Ask the user to confirm.

Slippage Defaults

If the user does not specify slippage, choose based on the token pair:

Pair type Default Rationale
Stablecoin ↔ Stablecoin (e.g. USDC→USDT) 5 bps (0.05%) Minimal price deviation between pegged assets
Common tokens (e.g. ETH→USDC, WBTC→ETH) 50 bps (0.50%) Standard volatility buffer
All other / unknown pairs 100 bps (1.00%) Conservative default for long-tail or volatile tokens

These are recommended defaults, not official KyberSwap values. The KyberSwap API defaults to slippageTolerance: 0 if omitted.

Note: The API defaults to 0 if slippageTolerance is omitted. Always pass an explicit value. The range is [0, 2000] (0% to 20%). Use ignoreCappedSlippage: true to exceed 20%.

Workflow

Step 1: Resolve Token Addresses

Read the token registry at ${CLAUDE_PLUGIN_ROOT}/references/token-registry.md.

Look up tokenIn and tokenOut for the specified chain. Match case-insensitively. Note the decimals for each token.

Aliases to handle:

  • "ETH" on Ethereum/Arbitrum/Optimism/Base/Linea/Unichain → native token address
  • "MATIC" or "POL" on Polygon → native token address
  • "BNB" on BSC → native token address
  • "AVAX" on Avalanche → native token address
  • "MNT" on Mantle → native token address
  • "S" on Sonic → native token address
  • "BERA" on Berachain → native token address
  • "RON" on Ronin → native token address
  • "XTZ" on Etherlink → native token address
  • "MON" on Monad → native token address

If a token is not found in the registry: Use the fallback sequence described at the bottom of ${CLAUDE_PLUGIN_ROOT}/references/token-registry.md:

  1. KyberSwap Token API (preferred) — search whitelisted tokens first: https://token-api.kyberswap.com/api/v1/public/tokens?chainIds={chainId}&name={symbol}&isWhitelisted=true via WebFetch. Pick the result whose symbol matches exactly with the highest marketCap. If no whitelisted match, retry without isWhitelisted (only trust verified or market-cap tokens). If still nothing, browse page=1&pageSize=100 (try up to 3 pages).
  2. CoinGecko API (secondary fallback) — search CoinGecko for verified contract addresses if the Token API doesn't have it.
  3. Ask user manually (final fallback) — if CoinGecko also fails, ask the user to provide the contract address. Never guess or fabricate addresses.

Step 2: Check Token Safety

For any token not in the built-in registry and not a native token, check the honeypot/FOT API:

GET https://token-api.kyberswap.com/api/v1/public/tokens/honeypot-fot-info?chainId={chainId}&address={tokenAddress}

Via WebFetch, check both tokenIn and tokenOut:

  • If isHoneypot: true — refuse the swap and warn the user that this token is flagged as a honeypot (cannot be sold after buying).
  • If isFOT: true — warn the user that this token has a fee-on-transfer (tax: {tax}%). The actual received amount will be less than the swap output. Proceed only if the user ackn
Полный SKILL.md на GitHub

Установить swap-build в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

SOURCE.mdTRUST.auto.yamlreferences/basic-swap.mdreferences/erc20-swap.md

FAQ

Что делает скилл swap-build?

This skill should be used when the user asks to "swap-build", "build a swap transaction", "build swap calldata", "create swap tx", "swap tokens", "trade crypto", "execute a token exchange", "swap ETH to USDC", "convert tokens", or needs encoded calldata for on-chain submission. Fetches the best route and builds transaction data via KyberSwap Aggregator.

Как установить скилл swap-build?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл swap-build запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить swap-build с