Sell Node
Sell Node 是专门用于卖出代币的交易执行节点,是 Swap Node 的实例节点。它提供清晰的卖出语义,简化了代币出售操作的配置。
节点信息
节点类型
sell_node
显示名称
Sell
节点分类
Trade(交易执行)
图标
📉 下跌趋势图标
句柄颜色
Amber(橙色) / Emerald(绿色)
节点类别
Instance Node(实例节点)
基类节点
swap_node
功能说明
Sell Node 专门用于卖出代币操作,内部使用 Swap Node 的完整交换功能,但提供了更直观的参数命名。用户只需指定要卖出的代币和换取的代币,节点自动处理交换逻辑。
主要用途:
卖出持有的代币
清晰的卖出语义
简化参数配置
自动处理交换方向
核心特性:
💸 卖出语义:
sell_token和base_token参数更直观🔄 自动映射:内部转换为 Swap Node 的 from/to 参数
📊 完整功能:继承 Swap Node 的所有功能
🎯 专注卖出:优化的用户体验
与 Swap Node 的关系
Sell Node 是 Swap Node 的实例节点,关系如下:
SwapNode (基类)
├─ from_token (源代币)
└─ to_token (目标代币)
↓ 实例化
SellNode (实例)
├─ sell_token → from_token (卖什么)
└─ base_token → to_token (换什么)参数映射:
sell_token→from_token(卖出的代币)base_token→to_token(换取的代币)
与 Buy Node 的对比:
Buy Node
买入
base_token(支付)
buy_token(获得)
Sell Node
卖出
sell_token(卖出)
base_token(换取)
输入参数
参数列表
sell_token
searchSelect
✅
-
要卖出的代币符号
base_token
searchSelect
✅
-
换取的代币符号
chain
searchSelect
✅
aptos
区块链网络
vault_address
text
✅
-
金库地址
amount_in_human_readable
switch
✅
{mode:"number",value:""}
卖出金额(Number/Percentage 模式切换)
slippery
number
✅
1.0
滑点容忍度(%)
order_type
select
✅
market
订单类型
limited_price
number
❌
-
限价(未实现)
sell_token 参数
说明: 您想要卖出的代币符号
示例:
APT- 卖出 Aptos CoinBTC- 卖出 BitcoinETH- 卖出 Ethereum
base_token 参数
说明: 换取的代币符号("换成什么")
示例:
USDT- 换取 USDTUSDC- 换取 USDCAPT- 换取 APT
amount_in_human_readable 参数
说明: 卖出金额,支持两种模式:精确数量(Number)和百分比(Percentage)
类型: Switch(模式切换器)
数据结构:
{
mode: "number" | "percentage", // 模式:精确数量 或 百分比
value: string // 数值(字符串形式)
}模式 1:Number(精确数量)
指定精确的 sell_token 数量进行卖出。
{
"sell_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "number",
"value": "10"
}
}
// 含义:卖出 10 APT 换取 USDT模式 2:Percentage(百分比)
按 sell_token 余额的百分比进行卖出(0-100)。
{
"sell_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "percentage",
"value": "50"
}
}
// 含义:卖出 50% 的 APT 余额换取 USDT前端 UI:
用户首先选择模式(Number 或 Percentage)
Number 模式:显示数字输入框
Percentage 模式:显示 0-100% 滑块 + 输入框
选择建议:
精确控制卖出数量 → 使用
number模式按持仓比例卖出 → 使用
percentage模式
order_type 参数
支持的类型:
market
市价单
✅ 已实现
limit
限价单
⏳ 未实现
说明:
当前仅支持市价单
限价单功能计划中
限价单可设置最低卖出价格
输出参数
输出列表
trade_receipt
Trade Receipt
object
完整的交易收据
trade_receipt 输出
数据结构与 Swap Node 完全相同,参见 Swap Node 文档。
关键字段:
from_token:sell_token值to_token:base_token值amount_in: 实际卖出数量amount_out: 实际换取数量tx_hash: 交易哈希
使用示例
示例 1:卖出 APT 换取 USDT
场景: 卖出 10 APT 换取 USDT。
工作流结构:
Vault Node (Aptos)
↓ vault_address
Sell Node (卖出 APT)
↓ trade_receipt
Telegram Sender Node (发送通知)Sell Node 配置:
{
"sell_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "number",
"value": "10"
},
"slippery": 1.0,
"chain": "aptos"
}交易理解:
卖出 10 APT 换取 USDT
根据当前价格,预计换取约 72.5 USDT(假设 APT=$7.25)
滑点保护:至少换取 71.78 USDT
示例 2:卖出 50% 持仓
场景: 卖出当前 BTC 持仓的 50%。
Sell Node 配置:
{
"sell_token": "BTC",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "percentage",
"value": "50"
},
"slippery": 0.5,
"chain": "aptos"
}执行过程:
1. 查询金库 BTC 余额:2.5 BTC
2. 计算卖出金额:2.5 * 50% = 1.25 BTC
3. 执行卖出:1.25 BTC → USDT示例 3:止盈策略
场景: 价格达到目标位时自动卖出。
工作流结构:
Binance Price Node (获取 APT 价格)
↓ kline_data
Code Node (检查价格)
↓ should_sell (true/false)
Condition Node (价格 > $10?)
↓ (true)
├─→ Vault Node → Sell Node (卖出)
↓ (false)
└─→ 继续持有Sell Node 配置:
{
"sell_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "percentage",
"value": "100"
},
"slippery": 2.0
}示例 4:AI 驱动止损
场景: AI 检测到风险信号时自动卖出。
工作流结构:
Binance Price Node (价格数据)
↓ kline_data
AI Model Node (风险分析)
↓ ai_response { risk_level: "high", action: "sell" }
↓
Code Node (解析 AI 建议)
↓
Condition Node (是否卖出?)
↓ (true)
Vault Node
↓
Sell Node (执行卖出)
↓ trade_receipt
Dataset Output Node (记录交易)示例 5:定期获利
场景: 定期卖出一定比例的盈利代币。
Sell Node 配置:
{
"sell_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "percentage",
"value": "10"
},
"slippery": 1.0
}
// 每次卖出 10% 的 APT 持仓最佳实践
1. 参数命名理解
Sell Node 语义:
我要卖出 [sell_token] 换取 [base_token]示例:
卖出 APT 换取 USDT ✅ 清晰
用 APT 换 USDT ✅ 同义
2. 与 Buy Node 的区别
Sell Node(卖出持仓):
{
"sell_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "number",
"value": "10"
}
}
// 卖出 10 APT,换取 USDTBuy Node(买入新仓):
{
"buy_token": "APT",
"base_token": "USDT",
"amount_in_human_readable": {
"mode": "number",
"value": "100"
}
}
// 用 100 USDT 买入 APT选择指南:
卖出持有的代币 → Sell Node
买入新的代币 → Buy Node
任意方向交换 → Swap Node
3. 卖出策略
全部卖出(Percentage 模式):
{
"amount_in_human_readable": {
"mode": "percentage",
"value": "100"
}
}分批卖出(Percentage 模式):
{
"amount_in_human_readable": {
"mode": "percentage",
"value": "25"
}
}
// 分 4 次卖出,每次 25%固定数量(Number 模式):
{
"amount_in_human_readable": {
"mode": "number",
"value": "5"
}
}
// 每次卖出固定 5 个代币4. 滑点设置建议
紧急止损
3.0-5.0%
确保成交
常规卖出
1.0-2.0%
平衡价格和成交
止盈卖出
0.5-1.0%
获得更好价格
注意事项
⚠️ 重要提示
参数方向理解
sell_token是卖出的代币(减少)base_token是换取的代币(增加)金额参数指的是
sell_token的数量
与 Buy Node 的对称性
Sell Node 和 Buy Node 是互为反向操作
Buy: 用 USDT 买 APT ↔ Sell: 卖 APT 换 USDT
参数顺序相反但逻辑相同
继承的限制
所有 Swap Node 的限制都适用
滑点、Gas、流动性等要求相同
卖出时机
市场波动大时考虑增加滑点
大额卖出可能影响市场价格
流动性不足时可能无法完全成交
订单类型
当前仅支持市价单
限价单(
limit)功能未实现limited_price参数暂时无效
故障排查
Q: 提示 "Token not found in holdings"?
A:
确认金库中确实持有要卖出的代币
检查
sell_token符号是否正确确认余额足够支付 Gas 费
Q: 实际换取的金额少于预期?
A:
这是正常现象,受市场价格影响
检查交易时的实时价格
滑点保护会设置最低价格
查看
amount_out_min和实际amount_out
Q: 应该使用 Sell Node 还是 Swap Node?
A:
使用 Sell Node:
✅ 明确的卖出操作
✅ 前端用户界面
✅ 止盈/止损策略
使用 Swap Node:
✅ 需要灵活的交换方向
✅ 程序化交易
✅ 不确定交换方向时
Q: 如何实现止损功能?
A:
Binance Price Node (监控价格)
↓
Code Node (判断是否触发止损)
↓ { trigger_stop_loss: true }
Condition Node (触发?)
↓ (true)
Vault Node → Sell Node (卖出止损)Q: 如何分批卖出?
A: 方案 1 - 多次执行:
Sell Node (amount_in_human_readable: { mode: "percentage", value: "25" })
// 手动执行 4 次方案 2 - 定时卖出:
每天执行一次工作流
Sell Node (amount_in_human_readable: { mode: "percentage", value: "25" })
// 4 天内分批卖完技术规格
节点版本
0.0.2
节点类别
Instance Node
基类节点
swap_node
继承功能
100%
支持的链
Aptos, Flow EVM
支持的 DEX
Hyperion (Aptos), Flow DEX
常见卖出策略
1. 固定止盈
价格 > 目标价 → 卖出全部2. 分批止盈
价格每上涨 10% → 卖出 20% 持仓3. 追踪止损
价格从最高点回落 5% → 卖出全部4. 时间止盈
持有 30 天 → 卖出 50% 锁定收益5. 风险控制
AI 风险评级 > 8 → 卖出减仓相关节点
Swap Node - 基类节点,通用代币交换
Buy Node - 买入代币的实例节点
Vault Node - 金库管理节点
Code Node - 预处理交易参数
Condition Node - 条件判断
相关文档:
节点与工作流 - 节点基础概念
Swap Node - 基类节点完整文档
Weather 语法 - 工作流文件格式
Last updated