微算力 · API 导航与自营网关
API 接入 EN
未登录登录
💱

智能多币种批量兑换管家

batch-swap · vv0.1.0
专业技能 安全 A 级 作者 wpank 公开目录收录
下载 1.8k 安装 822 收藏 4k 浏览 8.2k
下载 zip

简介

基于 Uniswap 的批量代币兑换技能,支持顺序执行多笔交易并独立安全验证,帮助用户高效完成投资组合再平衡与多步骤交易计划。

原始描述

Execute multiple token swaps in sequence. Use when user wants to rebalance, swap into multiple tokens, or execute a multi-step trading plan. Each swap goes through full safety validation independently.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/batch-swap/
其它 Agent解压到它自己的 skills 目录,目录名用 batch-swap

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

Batch Swap 是一个专门用于执行多笔代币交换的自动化工具,主要面向 DeFi 交易者和资产管理需求。用户可以通过自然语言指令(如"将 50% USDC 兑换为 ETH,50% 兑换为 WBTC")或结构化参数发起批量交易,系统会自动解析、验证并顺序执行。

核心工作流程包括三步:

  1. 预检阶段:通过 MCP 工具验证余额充足性和日交易限额
  2. 顺序执行:调用 trade-executor 子代理逐个完成 swap,每笔交易独立进行安全检查
  3. 汇总报告:生成包含每笔交易金额、汇率、交易哈希及总 gas 费用的结构化输出

关键参数 stopOnFailure 控制失败处理策略——默认为 true,首笔失败即终止批次,防止资金状态不一致。


显著优点

  • 操作简化:将多笔交易抽象为单条指令,显著降低操作复杂度和手动错误风险
  • 安全隔离:每笔 swap 独立验证,通过 MCP 工具间接调用 Uniswap 协议,不直接接触私钥
  • 透明可追踪:详细的执行报告便于审计和对账
  • 灵活配置:支持跨链指定(默认 Ethereum)、失败策略自定义

潜在局限与风险

局限 说明
来源可信度 T3 由个人开发者 (wpank) 维护,非知名机构背书,长期维护能力存疑
无开源协议 未声明 License,存在潜在知识产权风险
依赖子代理 实际交易执行依赖 trade-executor,其安全级别未在本报告中评估
顺序执行效率 非并行处理,大额批次可能面临 gas 波动风险
隐私数据暴露 MCP 工具需访问用户余额信息,存在数据泄露面

适合人群

  • DeFi 活跃交易者,需定期 Rebalancing 投资组合
  • DAO 财库管理者,执行多币种资产配置
  • 量化策略执行者,需按预设比例分散持仓

常规风险提示

  1. 智能合约风险:Uniswap 协议自身漏洞或代币合约问题可能导致资金损失
  2. 滑点与 MEV:未披露具体 slippage 保护机制,大额交易可能被三明治攻击
  3. 子代理依赖:务必独立审计 trade-executor 的安全实现
  4. T3 来源审慎:建议先在隔离环境测试,关注上游仓库更新动态
  5. MCP 服务器可信性:确认 MCP 节点非恶意篡改,防止伪造余额数据诱导交易

技能正文


description: >- Execute multiple token swaps in sequence. Use when user wants to rebalance, swap into multiple tokens, or execute a multi-step trading plan. Each swap goes through full safety validation independently. allowed-tools: >- Read, Glob, Grep, Task(subagent_type:trade-executor), mcp__uniswap__check_safety_status, mcp__uniswap__get_agent_balance model: opus

Batch Swap

Execute multiple token swaps in sequence with independent safety validation per swap.

Activation

Use this skill when the user says any of:

  • "Swap X for Y and Z"
  • "Rebalance to 50% ETH 50% USDC"
  • "Buy 3 different tokens"
  • "Execute these swaps: ..."

Input Extraction

Parameter Required Default Source
swaps Yes — List of {tokenIn, tokenOut, amount}
chain No ethereum Default chain for all swaps
stopOnFailure No true Whether to halt on first failure

Workflow

  1. Parse all swaps from the user's message. Confirm token symbols resolve.

  2. Pre-flight check: Verify total spending within daily limits and sufficient balance for all swaps using check_safety_status and get_agent_balance.

  3. Sequential execution: For each swap:

    • Launch Task(subagent_type:trade-executor) with swap parameters
    • Wait for confirmation before starting next swap
    • Update running balance between swaps
    • If stopOnFailure=true and swap fails, halt remaining swaps
  4. Report summary:

Batch Swap Complete (3/3 succeeded)

  #  Swap              Amount In    Amount Out   Tx
  1  USDC → WETH      1,000 USDC   0.307 WETH   0xABC...
  2  USDC → WBTC      1,000 USDC   0.015 WBTC   0xDEF...
  3  USDC → UNI       1,000 USDC   142.3 UNI    0xGHI...

  Total gas: $1.26

Error Handling

Error User Message Suggested Action
BATCH_PARTIAL_FAILURE "Swap #N failed. Remaining halted." Review failed swap, re-run remaining
INSUFFICIENT_BALANCE "Insufficient balance for full batch." Reduce amounts
SAFETY_AGGREGATE_LIMIT "Total batch exceeds daily limit." Reduce total batch size

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

finance-accountingautomationblockchaintradingcryptocurrency

同类 Skill