emblem-token-swap

emblem-token-swap

通过EmblemAI在6条区块链上执行代币交换。自动路由优化和通过ChangeNow实现的跨链桥接。当用户想要交换代币、兑换加密货币、转换货币或跨链桥接资产时使用。

12Star
2Fork
更新于 2026/5/15
SKILL.md
readonly只读
name
emblem-token-swap
description

通过EmblemAI在6条区块链上执行代币交换。自动路由优化和 通过ChangeNow实现的跨链桥接。当用户想要交换代币、兑换加密货币、 转换货币或跨链桥接资产时使用。

Emblem Token Swap

EmblemAI驱动的引导式代币交换。在Solana、Ethereum、Base、BSC、Polygon和Hedera上自动路由交换代币。通过ChangeNow实现跨链桥接。

需要npm install -g @emblemvault/agentwallet


此技能的功能

报价工具 交换工具 余额工具 代币搜索
Solana splBuyIntent(报价模式) splBuyIntent(交换模式) solanaBalances findSolanaSwapToken
Ethereum ethSwapQuote ethSwap ethGetBalances searchCryptoByName
Base baseSwapQuote baseSwap baseGetBalances searchEvmTokensBirdeye
BSC bscSwapQuote bscSwap bscGetBalances searchEvmTokensBirdeye
Polygon polygonSwapQuote polygonSwap polygonGetBalances searchEvmTokensBirdeye
Hedera hederaTokensSwapQuote hederaTokensSwap hederaGetBalances hederaFindTokens
跨链 getChangeNowSwapQuote swapUsingChangeNow getChangeNowSupportedCurrencies

说明

  • Solana使用splBuyIntent进行报价和执行——它通过名称/符号/合约地址查找代币,并支持灵活的数量(美元、SOL或代币数量)
  • EVM链(Ethereum、Base、BSC、Polygon)通过自动DEX聚合路由
  • 跨链通过ChangeNow桥接,支持500多种货币
  • 比特币支持余额查询(getBTCBalances),但没有链上交换工具——使用ChangeNow进行BTC桥接

快速开始

npm install -g @emblemvault/agentwallet

# Solana交换(使用splBuyIntent)
emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"

# 跨链桥接(使用ChangeNow)
emblemai --agent --profile default -m "Use getChangeNowSwapQuote to get a quote for bridging 0.05 ETH from Ethereum to SOL on Solana"

触发短语:

  • "将SOL兑换为USDC"
  • "将ETH兑换为USDT"
  • "转换我的代币"
  • "桥接代币到Base"

工作流程:安全代币交换

步骤1:检查余额

确认你有足够的源代币。

emblemai --agent --profile default -m "Use solanaBalances to show my Solana token balances"

步骤2:获取报价

在执行前预览交换。

emblemai --agent --profile default -m "Use splBuyIntent to get a quote for swapping 5 SOL to USDC"

步骤3:执行交换

emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"

安全模式需要你在执行前确认。

步骤4:验证

确认新余额。

emblemai --agent --profile default -m "Use solanaBalances to show my updated balances"

交换模式

Solana交换

# 按代币数量
emblemai --agent --profile default -m "Use splBuyIntent to swap 0.5 SOL for USDC"

# 按美元金额
emblemai --agent --profile default -m "Use splBuyIntent to swap $20 of SOL for JUP"

# 按代币名称
emblemai --agent --profile default -m "Use splBuyIntent to swap 100 USDC for BONK"

EVM交换

# Ethereum
emblemai --agent --profile default -m "Use ethSwapQuote to get a quote for swapping 0.01 ETH to USDC, then use ethSwap to execute"

# Base
emblemai --agent --profile default -m "Use baseSwapQuote to quote 0.005 ETH to USDC on Base"

# BSC
emblemai --agent --profile default -m "Use bscSwapQuote to quote 0.1 BNB to USDT on BSC"

# Polygon
emblemai --agent --profile default -m "Use polygonSwapQuote to quote 10 POL to USDC on Polygon"

Hedera交换

emblemai --agent --profile default -m "Use hederaTokensSwapQuote to get a quote for 100 HBAR to USDC, then use hederaTokensSwap to execute"

跨链桥接

emblemai --agent --profile default -m "Use getChangeNowSwapQuote to quote bridging 0.1 ETH to SOL"
emblemai --agent --profile default -m "Use getChangeNowSupportedCurrencies to show available bridge currencies"

沟通规则

交换请求中始终包含以下内容:

  1. 工具名称——指定确切的工具以确保可靠路由
  2. 数量——美元价值或代币数量
  3. 源代币——你要从什么交换
  4. 目标代币——你要交换到什么
错误 正确
"swap sol usdc" "Use splBuyIntent to swap 5 SOL for USDC"
"buy eth" "Use ethSwap to swap 100 USDC to ETH on Ethereum"
"bridge" "Use getChangeNowSwapQuote to bridge 0.05 ETH to SOL"

安全性

所有交换都需要用户明确确认(安全模式)。代理将:

  1. 显示交换详情(数量、路由、预估输出)
  2. 等待你的批准后再执行
  3. 报告交易结果

对于任何涉及资金转移的操作,绝不绕过确认。


辅助脚本

bash scripts/swap-helper.sh

参见 scripts/swap-helper.sh 获取交互式交换指南。


链接