Set futures stop-loss / take-profit
set_futures_sl_tpSet or clear stop-loss and take-profit triggers on an open paper futures position. A positive price sets the trigger; null clears it.
Instructions
Set or clear resting stop-loss / take-profit triggers on an OPEN mock futures position. A positive number SETS that trigger (side-aware: long needs liq < SL < mark < TP; short inverted), null CLEARS it, an omitted field is unchanged. Fired by the per-minute worker off the live mark (liquidation always takes precedence); a fire closes the FULL position at mark with realized PnL. Discover fills between polls via my_trades with updatedSince. Requires the trade:futures scope. Paper trading only — virtual funds (50,000 mUSD). Not financial advice. Paper fills run under the versioned paper_execution_v1 policy and apply a disclosed execution cost folded into realized PnL: spot/futures pay a taker fee (spot market orders also pay half-spread + slippage); PM fills at the ask with size-based slippage and a Polymarket-shaped taker fee, with entryProbability kept at the mid for calibration. See the executionModel in quote/trade results — a rehearsal cost, not an exchange fill guarantee.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentTrace | No | Optional private trace metadata stored in the caller's ledger. | |
| positionId | Yes | Open futures position id. | |
| stopLossPrice | No | Positive number sets; null clears; omit = unchanged. | |
| takeProfitPrice | No | Positive number sets; null clears; omit = unchanged. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when CoinRithm returned a successful 2xx response. | |
| body | No | Parsed CoinRithm response body, or raw text when the response is not JSON. | |
| httpStatus | Yes | HTTP status returned by CoinRithm, or 0 for network errors. | |
| ledgerStatus | No | Ledger write status header returned by CoinRithm, when present. | |
| ledgerEventId | No | Private AgentActionEvent id returned by /api/agent/*, when present. |