TRADEHUBTESTNET

All tools

tighten_stop_loss

Tighten a position's stop-loss · · scopes: positions:close

Move a held position's stop-loss closer to the current price, e.g. to breakeven or to lock in profit: the new stop is placed first, then the old one is cancelled, so the position is never unprotected. Use when the user asks to raise a long's stop or lower a short's. Not for widening a stop (never allowed while the position is open) or for closing (use close_perp_position_reduce_only). Inputs: symbol, stop_loss (USD per coin), venue. Works while trading is halted. Next: get_my_open_orders to see the new stop.

Call it

MCP tools/call

{"name": "tighten_stop_loss", "arguments": {"symbol": "BTC", "stop_loss": 81000}}

REST

POST /v1/positions/{symbol}/stop-loss
{"symbol": "BTC", "stop_loss": 81000}

Inputs

NameMeaning (* required)
symbol *Base coin, e.g. BTC
stop_loss *New stop price, USD per coin: closer to the price than the current stop (higher for a long, lower for a short), still on the loss side of the mark
venueVenue: sandbox, hyperliquid, okx, bybit or binance. Omitted: the agent's only venue, else hyperliquid, else your only connected venue, else sandbox

Returns

FieldMeaning and unit
okFalse when rejected or failed
request_idOrder request id; get_order_request_status(request_id) follows it
statuspending_approval, armed (a trigger entry waiting for its price), executed, rejected, failed, expired, declined, cancelled, or executing (TradeHub has not confirmed the outcome yet: check get_order_request_status)
venueVenue name
order_idVenue order id of the fill
sl_oidVenue order id of the protective stop
fill_priceAverage fill, USD per coin
filled_sizeFilled size, in the base coin (e.g. BTC), not USD
approval_expires_atWhile pending: when the approval request lapses, ISO 8601 UTC
errorWhy it was rejected or failed
checksChecks run at execution
receiptSigned receipt (compact JWS, EdDSA) once executed: request, checks, preview price, fill, slippage, order ids, delegation. Verify with /.well-known/tradehub-receipts.jwks
take_profitsset_take_profit_levels: the take-profits now on the exchange
trigger_pricestatus armed: opens at market when the mark reaches this, USD per coin
trigger_expires_atstatus armed: when it lapses unless reached, ISO 8601 UTC
feeOnce executed: the trading fee, estimated at once and replaced by the amount the exchange charged once its fill records show it

Rejections: error codes, each with what to do.

TradeHub never asks for withdrawal permissions.