liberfi-swap
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLiberFi Swap & Transaction
LiberFi 兑换与交易
Execute token swaps and broadcast transactions using the LiberFi CLI.
使用LiberFi CLI执行代币兑换并广播交易。
Pre-flight Checks
前置检查
See bootstrap.md for CLI installation and connectivity verification.
This skill's auth requirements:
| Command | Requires Auth |
|---|---|
| No |
| No |
| No |
| No |
| Yes (JWT, uses TEE wallet) |
| Yes (JWT, uses TEE wallet) |
Authentication pre-flight for swap execute / tx send:
- Run
lfi status --json - If not authenticated:
- Agent:
lfi login key --role AGENT --json - Human: →
lfi login <email> --jsonlfi verify <otpId> <code> --json
- Agent:
- Run to confirm wallet addresses
lfi whoami --json
Additional pre-flight for swap operations:
- Confirm the user knows the input/output token addresses (or help look them up via or
lfi swap tokens)lfi token search - Note: is now optional for
--account. If omitted, the server uses the authenticated user's TEE wallet address automatically.swap execute
查看bootstrap.md了解CLI安装和连接验证方法。
该技能的鉴权要求:
| 命令 | 需要鉴权 |
|---|---|
| 否 |
| 否 |
| 否 |
| 否 |
| 是(JWT,使用TEE钱包) |
| 是(JWT,使用TEE钱包) |
兑换执行/交易发送的鉴权前置检查:
- 运行
lfi status --json - 如果未完成鉴权:
- Agent:运行
lfi login key --role AGENT --json - 个人用户:运行→ 运行
lfi login <email> --jsonlfi verify <otpId> <code> --json
- Agent:运行
- 运行确认钱包地址
lfi whoami --json
兑换操作的额外前置检查:
- 确认用户已知输入/输出代币地址(或通过或
lfi swap tokens协助查询)lfi token search - 注意:命令的
swap execute参数现在是可选的。如果省略,服务端将自动使用已鉴权用户的TEE钱包地址。--account
Skill Routing
技能路由
| If user asks about... | Route to |
|---|---|
| Token search, price, details, security | liberfi-token |
| Token K-line, candlestick chart | liberfi-token |
| Token holders, smart money traders | liberfi-token |
| Trending tokens, market rankings | liberfi-market |
| Newly listed tokens | liberfi-market |
| Wallet holdings, balance, PnL | liberfi-portfolio |
| Wallet activity, transaction history | liberfi-portfolio |
| 如果用户询问... | 路由到 |
|---|---|
| 代币搜索、价格、详情、安全信息 | liberfi-token |
| 代币K线、蜡烛图 | liberfi-token |
| 代币持有者、聪明钱交易者 | liberfi-token |
| 热门代币、市场排名 | liberfi-market |
| 新上线代币 | liberfi-market |
| 钱包持仓、余额、盈亏 | liberfi-portfolio |
| 钱包活动、交易历史 | liberfi-portfolio |
CLI Command Index
CLI命令索引
Query Commands (read-only)
查询命令(只读)
| Command | Description | Auth |
|---|---|---|
| List all supported swap chains | No |
| List available swap tokens | No |
| 命令 | 描述 | 鉴权 |
|---|---|---|
| 列出所有支持兑换的公链 | 否 |
| 列出可用的兑换代币 | 否 |
Mutating Commands (generate transactions)
变更命令(生成交易)
| Command | Description | Auth |
|---|---|---|
| Get a swap quote | No |
| Execute swap via TEE wallet | Yes |
| Build, sign, and broadcast swap in one step via TEE wallet | Yes |
| Estimate transaction fee / gas | No |
| Broadcast a signed transaction | Yes |
| 命令 | 描述 | 鉴权 |
|---|---|---|
| 获取兑换报价 | 否 |
| 通过TEE钱包执行兑换 | 是 |
| 通过TEE钱包一步完成兑换交易的构建、签名和广播 | 是 |
| 估算交易手续费/Gas | 否 |
| 广播已签名的交易 | 是 |
Parameter Reference
参数参考
Swap quote & execute (shared parameters):
- — Required. Input token address
--in <address> - — Required. Output token address
--out <address> - — Required. Input amount in smallest unit (lamports, wei, etc.)
--amount <amount> - — Required.
--chain-family <family>orevmsvm - — Required. Numeric chain ID (e.g.
--chain-id <id>for Solana mainnet,0for Ethereum)1 - — Slippage tolerance in basis points (e.g.
--slippage-bps <bps>= 1%)100 - —
--swap-mode <mode>(default) orExactInExactOut
Execute-only additional parameter:
- — Optional. Wallet address override. If omitted, the server uses the authenticated user's TEE wallet automatically. Requires authentication.
--account <address> - — Opaque quote result JSON from a prior
--quote-result <json>call (pass through without modification)swap quote
Tx estimate parameters:
- — Required.
--chain-family <family>orevmsvm - — Required. Numeric chain ID
--chain-id <id> - — Required. Transaction data as JSON string (structure depends on chain family)
--data <json>
Sign-and-send parameters:
- — Required.
--chain-family <family>orevmsvm - — Required. Numeric chain ID
--chain-id <id> - — Required. Full quote result JSON from a prior
--quote-result <json>call (pass through without modification)lfi swap quote - — Override slippage tolerance in basis points
--slippage-bps <bps>
Tx send parameters:
- — Required.
--chain-family <family>orevmsvm - — Required. Numeric chain ID
--chain-id <id> - — Required. Signed transaction in base64 or hex encoding
--signed-tx <data>
兑换报价与执行(共用参数):
- — 必填。输入代币地址
--in <address> - — 必填。输出代币地址
--out <address> - — 必填。输入金额,以最小单位计算(lamports、wei等)
--amount <amount> - — 必填。
--chain-family <family>或evmsvm - — 必填。数字链ID(例如Solana主网为
--chain-id <id>,以太坊主网为0)1 - — 滑点容忍度,单位为基点(例如
--slippage-bps <bps>= 1%)100 - —
--swap-mode <mode>(默认)或ExactInExactOut
仅执行命令的额外参数:
- — 可选。覆盖钱包地址。如果省略,服务端将自动使用已鉴权用户的TEE钱包。需要提前鉴权。
--account <address> - — 之前调用
--quote-result <json>返回的不透明报价结果JSON(直接透传即可,无需修改)swap quote
交易估算参数:
- — 必填。
--chain-family <family>或evmsvm - — 必填。数字链ID
--chain-id <id> - — 必填。JSON格式的交易数据(结构取决于链家族)
--data <json>
签名并发送参数:
- — 必填。
--chain-family <family>或evmsvm - — 必填。数字链ID
--chain-id <id> - — 必填。之前调用
--quote-result <json>返回的完整报价结果JSON(直接透传即可,无需修改)lfi swap quote - — 覆盖滑点容忍度,单位为基点
--slippage-bps <bps>
交易发送参数:
- — 必填。
--chain-family <family>或evmsvm - — 必填。数字链ID
--chain-id <id> - — 必填。base64或十六进制编码的已签名交易
--signed-tx <data>
Operation Flow
操作流程
List Supported Chains
列出支持的公链
- Fetch chains:
lfi swap chains --json - Present: Show chain name, chain ID, chain family (evm/svm)
- Suggest next step: "Which chain do you want to trade on?"
- 获取公链列表:
lfi swap chains --json - 展示:显示公链名称、链ID、链家族(evm/svm)
- 建议下一步:“你想在哪条链上交易?”
Find Available Tokens
查询可用代币
- Fetch tokens:
lfi swap tokens --chain-id <id> --json - Present: Show token name, symbol, address
- Suggest next step: "Which tokens do you want to swap?"
- 获取代币列表:
lfi swap tokens --chain-id <id> --json - 展示:显示代币名称、符号、地址
- 建议下一步:“你想兑换哪些代币?”
Get a Swap Quote
获取兑换报价
- Collect inputs: Input token, output token, amount, chain family, chain ID
- (mandatory) Run security check:
lfi token security <chain> <outputTokenAddress> --json - Review security result — warn user if any risk flags
- Get quote:
lfi swap quote --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --json - Present: Show input amount, expected output amount, price impact, slippage, route
- Suggest next step: "Want to execute this swap?"
- 收集输入信息:输入代币、输出代币、金额、链家族、链ID
- (强制要求) 运行安全检查:
lfi token security <chain> <outputTokenAddress> --json - 查看安全检查结果 — 如果存在风险标记需警告用户
- 获取报价:
lfi swap quote --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --json - 展示:显示输入金额、预期输出金额、价格影响、滑点、路由
- 建议下一步:“要执行这笔兑换吗?”
Execute a Swap (Full Flow)
执行兑换(完整流程)
Authentication pre-flight (do this first):
bash
lfi status --json # check session鉴权前置检查(优先执行):
bash
lfi status --json # 检查会话状态If not authenticated:
如果未鉴权:
lfi login key --role AGENT --json # agent
lfi login key --role AGENT --json # Agent用户
or: lfi login <email> --json → lfi verify <otpId> <code> --json
或: lfi login <email> --json → lfi verify <otpId> <code> --json
lfi whoami --json # confirm evmAddress / solAddress
1. **Collect inputs**: Input/output tokens, amount, chain
2. **(mandatory)** Security check: `lfi token security <chain> <outputTokenAddress> --json`
3. If security flags found → warn user, recommend NOT proceeding
4. **Get quote first**: `lfi swap quote --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --json`
5. **Present swap summary to user**:
- Input: X amount of TokenA
- Output: ~Y amount of TokenB
- Slippage: Z%
- Estimated fees (if available)
6. **(mandatory)** Wait for explicit user confirmation
7. **Execute swap**: `lfi swap execute --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --quote-result '<quoteJson>' --json`
- The server signs the transaction using the authenticated user's TEE wallet.
- No manual signing step required — the response contains the result or signed tx hash.
8. **Suggest next step**: "Swap submitted! You can track it on the block explorer."lfi whoami --json # 确认evmAddress / solAddress
1. **收集输入信息**:输入/输出代币、金额、公链
2. **(强制要求)** 安全检查:`lfi token security <chain> <outputTokenAddress> --json`
3. 如果发现安全风险标记 → 警告用户,建议不要继续操作
4. **优先获取报价**:`lfi swap quote --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --json`
5. **向用户展示兑换摘要**:
- 输入:X数量的TokenA
- 输出:约Y数量的TokenB
- 滑点:Z%
- 预估手续费(如有)
6. **(强制要求)** 等待用户明确确认
7. **执行兑换**:`lfi swap execute --in <in> --out <out> --amount <amt> --chain-family <fam> --chain-id <id> --quote-result '<quoteJson>' --json`
- 服务端使用已鉴权用户的TEE钱包对交易签名
- 无需手动签名步骤 — 响应包含执行结果或已签名交易哈希
8. **建议下一步**:“兑换已提交!你可以在区块浏览器上追踪交易状态。”Execute Swap in One Step (sign-and-send)
一步执行兑换(签名并发送)
Use this when you already have a quote result and want to build, sign, and broadcast in a single call — no separate needed.
swap executeAuthentication pre-flight (do this first):
bash
lfi status --json # check session如果你已经获取了报价结果,想要在单次调用中完成构建、签名和广播操作,可使用该方法 — 无需单独调用。
swap execute鉴权前置检查(优先执行):
bash
lfi status --json # 检查会话状态If not authenticated:
如果未鉴权:
lfi login key --role AGENT --json # agent
lfi login key --role AGENT --json # Agent用户
or: lfi login <email> --json → lfi verify <otpId> <code> --json
或: lfi login <email> --json → lfi verify <otpId> <code> --json
1. **Collect inputs**: Chain family, chain ID, and the quote result JSON from a prior `swap quote` call
2. **(mandatory)** Security check already performed during the quote step — do not skip
3. **Present swap summary** and wait for explicit user confirmation
4. **Execute**: `lfi swap sign-and-send --chain-family <fam> --chain-id <id> --quote-result '<quoteJson>' --json`
- The server builds the transaction, signs it via the authenticated user's TEE wallet, and broadcasts it in one step.
5. **Suggest next step**: "Swap submitted! You can track it on the block explorer."
**When to use `sign-and-send` vs `execute`**:
- Use `sign-and-send` when you already have a `quote_result` and want a single atomic call.
- Use `execute` when you want to specify input/output tokens and amount directly (it internally fetches a quote).
1. **收集输入信息**:链家族、链ID,以及之前调用`swap quote`返回的报价结果JSON
2. **(强制要求)** 报价阶段已经完成安全检查 — 不要跳过该步骤
3. **展示兑换摘要**并等待用户明确确认
4. **执行**:`lfi swap sign-and-send --chain-family <fam> --chain-id <id> --quote-result '<quoteJson>' --json`
- 服务端构建交易,通过已鉴权用户的TEE钱包签名,然后一步完成广播
5. **建议下一步**:“兑换已提交!你可以在区块浏览器上追踪交易状态。”
**`sign-and-send`与`execute`的适用场景**:
- 如果你已经获取了`quote_result`,想要单次原子调用完成操作,使用`sign-and-send`
- 如果你想要直接指定输入/输出代币和金额(内部会自动获取报价),使用`execute`Estimate Transaction Fee
估算交易手续费
- Estimate:
lfi tx estimate --chain-family <fam> --chain-id <id> --data '<txJson>' --json - Present: Show estimated gas/fee in native token and USD equivalent
- Suggest next step: "Ready to send?"
- 估算:
lfi tx estimate --chain-family <fam> --chain-id <id> --data '<txJson>' --json - 展示:显示预估的Gas/手续费(原生代币计价和等价美元金额)
- 建议下一步:“准备好发送交易了吗?”
Broadcast Signed Transaction (when using external wallet)
广播已签名交易(使用外部钱包时)
When the user has signed the transaction externally (not using TEE wallet):
- (mandatory) Ensure authenticated:
lfi status --json - (mandatory) Final confirmation: "Are you sure you want to broadcast this transaction? This is irreversible."
- Send:
lfi tx send --chain-family <fam> --chain-id <id> --signed-tx <signedData> --json - Present: Show transaction hash
- Suggest next step: "Transaction submitted! You can track it on the block explorer."
当用户使用外部钱包完成了交易签名(不使用TEE钱包)时:
- (强制要求) 确认已完成鉴权:
lfi status --json - (强制要求) 最终确认:“你确定要广播这笔交易吗?该操作不可撤销。”
- 发送:
lfi tx send --chain-family <fam> --chain-id <id> --signed-tx <signedData> --json - 展示:显示交易哈希
- 建议下一步:“交易已提交!你可以在区块浏览器上追踪交易状态。”
Cross-Skill Workflows
跨技能工作流
"I want to swap SOL for USDC"
“我想把SOL换成USDC”
Full flow: auth → token → swap
- auth → — Check session; if not authed →
lfi status --jsonlfi login key --json - auth → — Confirm solAddress
lfi whoami --json - token → — Find USDC address on Solana
lfi token search --q "USDC" --chains sol --json - token → — Security check (mandatory)
lfi token security sol <usdcAddress> --json - swap → — Get quote
lfi swap quote --in So11111111111111111111111111111111111111112 --out <usdcAddress> --amount <amt> --chain-family svm --chain-id 0 --json - Present quote summary, wait for user confirmation
- swap → — Server signs via TEE wallet
lfi swap execute --in ... --out ... --amount ... --chain-family svm --chain-id 0 --json
完整流程:鉴权 → 代币查询 → 兑换
- 鉴权 → 运行— 检查会话;如果未鉴权 → 运行
lfi status --jsonlfi login key --json - 鉴权 → 运行— 确认solAddress
lfi whoami --json - 代币查询 → 运行— 查询Solana上的USDC地址
lfi token search --q "USDC" --chains sol --json - 代币查询 → 运行— 安全检查(强制要求)
lfi token security sol <usdcAddress> --json - 兑换 → 运行— 获取报价
lfi swap quote --in So11111111111111111111111111111111111111112 --out <usdcAddress> --amount <amt> --chain-family svm --chain-id 0 --json - 展示报价摘要,等待用户确认
- 兑换 → 运行— 服务端通过TEE钱包签名
lfi swap execute --in ... --out ... --amount ... --chain-family svm --chain-id 0 --json
"What's the best price to buy this trending token?"
“买这个热门代币的最优价格是多少?”
Full flow: auth → market → token → swap
- auth → — Check session; if not authed →
lfi status --jsonlfi login key --json - market → — Get trending tokens
lfi ranking trending sol 1h --limit 5 --json - User picks a token
- token → — Mandatory security check
lfi token security sol <address> --json - swap →
lfi swap quote --in <baseToken> --out <address> --amount <amt> --chain-family svm --chain-id 0 --json - Present quote with price impact analysis, wait for confirmation
- swap → — Server signs via TEE wallet
lfi swap execute --in ... --out ... --json
完整流程:鉴权 → 市场查询 → 代币查询 → 兑换
- 鉴权 → 运行— 检查会话;如果未鉴权 → 运行
lfi status --jsonlfi login key --json - 市场查询 → 运行— 获取热门代币列表
lfi ranking trending sol 1h --limit 5 --json - 用户选择一个代币
- 代币查询 → 运行— 强制安全检查
lfi token security sol <address> --json - 兑换 → 运行
lfi swap quote --in <baseToken> --out <address> --amount <amt> --chain-family svm --chain-id 0 --json - 展示报价和价格影响分析,等待用户确认
- 兑换 → 运行— 服务端通过TEE钱包签名
lfi swap execute --in ... --out ... --json
"Check my wallet, then sell half of my biggest holding"
“查看我的钱包,然后把我持仓最多的代币卖出一半”
Full flow: auth → portfolio → token → swap
- auth → — Check session; if not authed →
lfi status --jsonlfi login key --json - auth → — Get solAddress / evmAddress
lfi whoami --json - portfolio → — Get holdings
lfi wallet holdings sol <solAddress> --json - Identify largest holding, calculate half amount in smallest unit
- token → — Security check
lfi token security sol <tokenAddress> --json - swap →
lfi swap quote --in <tokenAddress> --out <baseToken> --amount <halfAmt> --chain-family svm --chain-id 0 --json - Present quote, wait for confirmation
- swap → — Server signs via TEE wallet
lfi swap execute --in ... --out ... --json
完整流程:鉴权 → 资产查询 → 代币查询 → 兑换
- 鉴权 → 运行— 检查会话;如果未鉴权 → 运行
lfi status --jsonlfi login key --json - 鉴权 → 运行— 获取solAddress / evmAddress
lfi whoami --json - 资产查询 → 运行— 获取持仓列表
lfi wallet holdings sol <solAddress> --json - 识别最大持仓,计算一半金额的最小单位数值
- 代币查询 → 运行— 安全检查
lfi token security sol <tokenAddress> --json - 兑换 → 运行
lfi swap quote --in <tokenAddress> --out <baseToken> --amount <halfAmt> --chain-family svm --chain-id 0 --json - 展示报价,等待用户确认
- 兑换 → 运行— 服务端通过TEE钱包签名
lfi swap execute --in ... --out ... --json
Suggest Next Steps
建议下一步操作
| Just completed | Suggest to user |
|---|---|
| Chain list | "Which chain do you want to trade on?" / "想在哪条链上交易?" |
| Token list | "Which tokens do you want to swap?" / "想兑换哪些代币?" |
| Swap quote | "Want to execute this swap?" / "要执行这笔兑换吗?" |
| Swap execute (TEE) | "Swap submitted via your LiberFi TEE wallet!" / "已通过LiberFi TEE钱包提交兑换!" |
| Swap sign-and-send | "Swap built, signed, and broadcast in one step!" / "兑换已一步完成构建、签名并广播!" |
| Fee estimate | "Ready to send?" / "准备好发送了吗?" |
| Tx send | "Transaction submitted! Track it on the block explorer." / "交易已提交!可在区块浏览器上查看。" |
| Not authenticated | "Please log in first: |
| 刚完成的操作 | 向用户建议 |
|---|---|
| 公链列表查询 | "Which chain do you want to trade on?" / "想在哪条链上交易?" |
| 代币列表查询 | "Which tokens do you want to swap?" / "想兑换哪些代币?" |
| 兑换报价查询 | "Want to execute this swap?" / "要执行这笔兑换吗?" |
| 兑换执行(TEE钱包) | "Swap submitted via your LiberFi TEE wallet!" / "已通过LiberFi TEE钱包提交兑换!" |
| 兑换签名并发送 | "Swap built, signed, and broadcast in one step!" / "兑换已一步完成构建、签名并广播!" |
| 手续费估算 | "Ready to send?" / "准备好发送了吗?" |
| 交易发送 | "Transaction submitted! Track it on the block explorer." / "交易已提交!可在区块浏览器上查看。" |
| 未鉴权 | "Please log in first: |
Edge Cases
边缘场景
- Insufficient balance: If the swap execute fails with an insufficient balance error, inform the user and suggest checking their holdings via
lfi wallet holdings - Slippage exceeded: If the quote shows high price impact (>5%), warn the user and suggest reducing the amount or increasing slippage tolerance
- Invalid token address: Validate format before calling the API; ask user to verify the address
- Unknown chain family: Only and
evmare supported; if user mentions a chain, map it to the correct family (e.g. Solana →svm, Ethereum/BSC/Base →svm)evm - Amount format error: Remind user that amounts must be in smallest unit (lamports for SOL = amount * 10^9, wei for ETH = amount * 10^18)
- Transaction already submitted: If tx send fails, warn that the transaction may have already been broadcast; check status before retrying
- Quote expired: Quotes have a limited validity window; if too much time passes, get a new quote before executing
- Network timeout: Retry once after 3 seconds; if still fails, suggest checking connectivity
- 余额不足:如果兑换执行因余额不足失败,告知用户并建议通过查询持仓
lfi wallet holdings - 滑点超出:如果报价显示价格影响过高(>5%),警告用户并建议减少兑换金额或提高滑点容忍度
- 无效代币地址:调用API前验证地址格式;要求用户确认地址是否正确
- 未知链家族:仅支持和
evm;如果用户提到某条公链,映射到正确的家族(例如Solana →svm,以太坊/BSC/Base →svm)evm - 金额格式错误:提醒用户金额必须以最小单位计算(SOL的lamports = 金额 * 10^9,ETH的wei = 金额 * 10^18)
- 交易已提交:如果交易发送失败,警告用户该交易可能已经广播;重试前先查询状态
- 报价过期:报价有效期有限;如果间隔时间过长,执行前先获取新的报价
- 网络超时:3秒后重试一次;如果仍然失败,建议检查网络连接
Common Pitfalls
常见误区
| Pitfall | Correct Approach |
|---|---|
| Using human-readable amounts (e.g. "1 SOL") | Convert to smallest unit first: 1 SOL = 1,000,000,000 lamports |
| Skipping security check before swap | ALWAYS run |
| Executing swap without user confirmation | ALWAYS show quote summary and wait for explicit "yes" |
| Passing modified quote_result to execute / sign-and-send | Pass the quote_result JSON through WITHOUT any modification |
Calling | Check |
| Assuming a wallet address without checking | Call |
| Retrying failed tx send without checking | The tx may have been submitted; check on-chain status first |
Using | Call |
| 误区 | 正确做法 |
|---|---|
| 使用可读金额(例如“1 SOL”) | 先转换为最小单位:1 SOL = 1,000,000,000 lamports |
| 兑换前跳过安全检查 | 始终先对输出代币运行 |
| 未获得用户确认就执行兑换 | 始终展示报价摘要并等待用户明确回复“是” |
| 向execute/sign-and-send传递修改后的quote_result | 直接透传quote_result JSON,不要做任何修改 |
未鉴权就调用 | 先调用 |
| 不检查就默认使用某个钱包地址 | 调用 |
| 发送失败不检查就重试 | 交易可能已经提交;先查询链上状态 |
没有报价就使用 | 先调用 |
Security Notes
安全说明
See security-policy.md for global security rules.
Skill-specific rules:
- Swap and transaction operations are HIGH RISK — they can move funds irreversibly
- NEVER execute or
swap executewithout explicit user confirmationtx send - ALWAYS run on the output token before presenting a swap quote
token security - If the security audit reveals honeypot or high tax flags, strongly recommend the user NOT proceed
- The field is opaque — pass it through as-is; do not interpret, modify, or display its raw content
quote_result - Transaction amounts in smallest unit are easy to get wrong — always double-check with the user: "You want to swap X SOL (= Y lamports), correct?"
- After broadcasting, provide the transaction hash so the user can independently verify on a block explorer
查看security-policy.md了解全局安全规则。
技能专属规则:
- 兑换和交易操作属于高风险操作 — 资金转移后不可撤销
- 没有用户明确确认的情况下,绝对不要执行或
swap executetx send - 展示兑换报价前,始终对输出代币运行检查
token security - 如果安全审计发现蜜罐或高税率标记,强烈建议用户不要继续操作
- 字段是不透明的 — 直接透传即可;不要解析、修改或展示其原始内容
quote_result - 最小单位的交易金额很容易出错 — 始终和用户二次确认:“你要兑换X SOL (= Y lamports),对吗?”
- 广播交易后提供交易哈希,方便用户在区块浏览器上独立验证