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★ 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:
- GET the optimal route (same as the quote skill)
- Show quote details and ask for user confirmation
- 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 1000.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:
- KyberSwap Token API (preferred) — search whitelisted tokens first:
https://token-api.kyberswap.com/api/v1/public/tokens?chainIds={chainId}&name={symbol}&isWhitelisted=truevia WebFetch. Pick the result whosesymbolmatches exactly with the highestmarketCap. If no whitelisted match, retry withoutisWhitelisted(only trust verified or market-cap tokens). If still nothing, browsepage=1&pageSize=100(try up to 3 pages). - CoinGecko API (secondary fallback) — search CoinGecko for verified contract addresses if the Token API doesn't have it.
- 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
Установить swap-build в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic