简介
基于 Uniswap 跨链桥基础设施实现代币跨链兑换,自动处理报价、安全验证、桥接监控与目标链确认,支持 ETH、USDC 等主流资产在以太坊、Arbitrum、Base 等链间无缝流转。
原始描述
Execute a cross-chain token swap via Uniswap's bridge infrastructure. Handles quoting, safety validation, bridge monitoring, and destination confirmation. Use when the user wants to swap tokens across different chains.
通过你的 Agent 添加
点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。
或者手动安装
包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。
技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。
中文使用说明 来自收录源
核心用法
Cross-Chain Swap 是一款专为实现跨链代币兑换设计的自动化技能,依托 Uniswap 的桥接基础设施,将原本复杂的跨链操作流程封装为单点调用。用户只需指定源链代币、目标链代币及兑换数量,系统即可自动完成全链路执行:从实时报价获取、多路径路由评估,到智能合约安全校验、链上交易执行,再到跨链桥接状态监控与目标链到账确认。
典型使用场景包括:将 Arbitrum 上的 ETH 兑换为 Base 上的 USDC,或把以太坊主网的资产跨链迁移至 Optimism 并自动完成代币转换。技能支持自定义滑点容忍度(默认自动)与自定义收款地址,适配个人资产管理、套利策略执行及多链流动性调配等需求。
显著优点
全流程自动化:无需用户手动切换网络、签署多笔交易或追踪桥接状态,7 步工作流由 cross-chain-executor 代理无缝处理。 实时风险管控:内置安全校验与风险评估双层机制,对异常代币合约、价格波动及桥接风险进行实时拦截。 透明化追踪:提供源链交易哈希、桥接 ID 与目标链交易哈希三重凭证,配合预估到账时间与费用明细,信息完整可追溯。 故障自愈能力:桥接卡顿或失败时自动触发状态监控与恢复指引,资金安全保障机制明确。
潜在局限
结算时效性:跨链桥接依赖底层桥基础设施,通常需 1-10 分钟完成结算,不适合对时效极端敏感的场景。 费用结构复杂:除常规 Gas 与兑换滑点外,需额外支付桥接费,小额交易可能面临成本占比过高的问题。 链与代币覆盖边界:仅支持 Uniswap 生态集成的链与代币,长尾资产或新兴链可能存在支持盲区。 智能合约风险:虽有多层安全校验,但跨链桥本身仍是行业公认的高风险基础设施,历史多起桥接合约遭攻击事件需警惕。
适合人群
多链资产配置者、跨链套利交易者、DeFi 高级用户、DAO 财库管理人,以及任何需要在不同 L1/L2 网络间高效调配代币流动性、同时希望降低手动操作复杂度的加密货币持有者。
常规风险
- 桥接合约风险:Uniswap 或其集成的第三方桥协议若遭遇漏洞利用,可能导致资金损失。 - 价格滑点与 MEV:跨链期间价格波动及链上抢先交易可能使实际到账低于预期。 - 网络拥堵:源链或目标链 Gas 飙升可能导致交易 pending 或失败。 - 人为输入错误:合约地址或链名称误填可能导致资金转入不可控地址,需仔细核对参数。
技能正文
name: cross-chain-swap description: Execute a cross-chain token swap via Uniswap's bridge infrastructure. Handles quoting, safety validation, bridge monitoring, and destination confirmation. Use when the user wants to swap tokens across different chains. model: opus allowed-tools: [Task(subagent_type:cross-chain-executor), mcp__uniswap__getSupportedChains, mcp__uniswap__getTokenInfo]
Cross-Chain Swap
Overview
Executes a cross-chain token swap — swapping a token on one chain for a different (or same) token on another chain. Delegates the full workflow to the cross-chain-executor agent, which handles quoting, route evaluation, safety checks, bridge monitoring, and destination confirmation.
When to Use
Activate when the user asks:
- "Swap ETH on Arbitrum for USDC on Base"
- "Cross-chain swap"
- "Buy USDC on Optimism using ETH from mainnet"
- "Move my ETH from Ethereum to Arbitrum and convert to USDC"
- "Swap tokens across chains"
- "Exchange X on chain A for Y on chain B"
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
| tokenIn | Yes | — | Input token symbol or address on source chain |
| tokenOut | Yes | — | Output token symbol or address on destination chain |
| amount | Yes | — | Amount to swap (human-readable, e.g., "1.5" or "1000") |
| sourceChain | Yes | — | Source chain name (e.g., "ethereum", "arbitrum") |
| destChain | Yes | — | Destination chain name (e.g., "base", "optimism") |
| slippage | No | auto | Slippage tolerance (e.g., "0.5" for 0.5%) |
| recipient | No | Same wallet | Recipient address on destination chain |
Workflow
-
Extract parameters from the user's request. Identify:
- Which token they want to send and on which chain.
- Which token they want to receive and on which chain.
- The amount to swap.
- Resolve ambiguous chain references (e.g., "mainnet" = "ethereum").
-
Validate inputs:
- Verify both chains are supported via
mcp__uniswap__getSupportedChains. - Verify tokens exist on their respective chains via
mcp__uniswap__getTokenInfo. - If source and destination chain are the same: redirect to
execute-swapskill instead.
- Verify both chains are supported via
-
Delegate to cross-chain-executor: Invoke
Task(subagent_type:cross-chain-executor)with:- tokenIn, tokenOut, amount, sourceChain, destChain, slippage, recipient.
- The agent handles the full 7-step workflow: quote, risk assessment, safety check, execution, bridge monitoring, confirmation, and reporting.
-
Present results: Format the execution report for the user, highlighting:
- Amounts sent and received.
- Total fees (gas + bridge).
- Settlement time.
- Any warnings from safety or risk checks.
Output Format
Cross-Chain Swap Complete
Source: 1.5 ETH on Ethereum
Destination: 2,850.25 USDC on Base
Fees: $3.50 (gas: $2.50, bridge: $1.00)
Settlement: 2 min 35 sec
Source Tx: 0xabc...123
Bridge ID: 0x789...abc
Dest Tx: 0xdef...456
Risk: LOW | Safety: APPROVED
Important Notes
- Cross-chain swaps involve bridge operations that take time to settle (typically 1-10 minutes).
- The skill will monitor the bridge and report status updates during settlement.
- Bridge fees and slippage apply in addition to normal swap fees.
- If the bridge gets stuck, the executor will escalate with recovery instructions.
Error Handling
| Error | User-Facing Message | Suggested Action |
|---|---|---|
| Unsupported chain | "Chain [name] is not supported for cross-chain swaps." | Check supported chains |
| Same chain | "Source and destination are the same chain. Use a regular swap." | Use execute-swap skill |
| Safety veto | "This swap was blocked by safety checks: [reason]." | Reduce amount or check token |
| Risk veto | "Risk assessment vetoed: [reason]." | Choose a different route or amount |
| Bridge stuck | "Bridge settlement is taking longer than expected." | Wait or check order ID manually |
| Bridge failed | "Bridge operation failed. Funds should remain on source chain." | Check source wallet balance |
| Insufficient balance | "Not enough [token] on [chain] to execute this swap." | Check balance and reduce amount |
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。