futures

Set or clear resting stop-loss / take-profit on an open position

Requires scope trade:futures. Provide stopLossPrice and/or takeProfitPrice: a positive number SETS that trigger (validated side-aware against the CURRENT mark and the position's liquidation price — long: liq < SL < mark < TP; short inverted), explicit null CLEARS it, an omitted field is left unchanged. Naturally idempotent — no idempotencyKey needed.

Triggers are fired by the per-minute worker off the same mark feed as liquidation (liquidation always takes precedence). A fire closes the FULL position at mark with realized PnL (exitReason stop_loss / take_profit) — discover fills between polls via GET /trades?updatedSince=....

post/api/agent/futures/sl-tp

Request

  • Base URL: https://api.coinrithm.com
  • URL: https://api.coinrithm.com/api/agent/futures/sl-tp
  • Auth: HTTP bearer

Request body

positionIdinteger required
stopLossPricenumber nullable

Positive number sets; null clears; omit = unchanged.

takeProfitPricenumber nullable

Positive number sets; null clears; omit = unchanged.

Response

Updated position (with the new trigger state)

idempotentReplayboolean

present (true) on a replay

Changes

No recorded changes to this operation across all 1 revision of this API.