设置止盈止损
build_set_tp_slSets take-profit and stop-loss orders for an existing position by replacing prior orders in one transaction; the remaining order auto-cancels when the position closes.
Instructions
为已有仓位设置止盈和 / 或止损:同一笔交易里先撤掉该仓位原有的止盈止损,再按新价格挂单(仓位平掉时另一张自动撤)。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"account": "<account>",
"market": "<market>",
"side": "<side>",
"slippagePct": "<slippagePct>"
},
"name": "build_set_tp_sl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | long 做多,short 做空 | |
| agent | No | agent 专用通道:填 agent 自己的钱包地址后,交易由 agent 用自己的私钥直接签名发送,不用用户逐笔确认(用户需先用 build_agent_authorize 授权这个地址)。不填则由用户钱包签名 | |
| market | Yes | 市场:短链接 slug、市场合约地址、代币地址、代币代号,或标的代号如 BTC / ETH / XAU(表示该标的的官方市场) | |
| account | Yes | 用户钱包地址(交易的签名人和收款人) | |
| stopLoss | No | ||
| takeProfit | No | ||
| slippagePct | Yes | 滑点百分数,默认 0.3(即 0.3%) |