set_stop
Tighten an open perpetual position's stop-loss toward the mark to lock in gains or cut risk. Places the new stop first, then cancels older stops; never widens.
Instructions
LIVE MONEY: acts on the real account. Move an open position's stop-loss tighter, toward the mark, to lock in gains or cut risk; never wider. One stop for the whole position goes on first, then every older stop on the coin is cancelled, so the position is never unprotected and a refused new order leaves the old one in place. Refused: no open position, a stop past the mark (it would fire at once), or a stop wider than or equal to the current one (a long's new stop must be above it, a short's below). With no stop at all, any stop on the right side of the mark is placed. Never changes the target or the size. To widen a stop, close and re-enter with place_bracket; to move the target use set_target. Needs a trading key. Returns {ok, stop_px, size, mark, replaced: old stop prices}; a refusal is {ok: false, reason, mark, current_stop} with isError true and nothing sent.
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": {
"coin": "<coin>",
"stop_px": "<stop_px>"
},
"name": "set_stop"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Coin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL). | |
| stop_px | Yes | New stop: above the current stop for a long, below it for a short, and on the safe side of the mark. |