Open futures position
open_futures_positionOpen or add to a mock futures position with isolated margin, leverage, and optional atomic stop-loss/take-profit. Requires a unique idempotency key; paper trading only.
Instructions
Open (or add to) a mock futures position. Requires the trade:futures scope. Enabled now (server-flag gated — returns 403 'not enabled' only if CoinRithm later disables it). idempotencyKey is REQUIRED and must be unique per intent. leverage 1-20, marginMusd >= 10. Optionally set stopLossPrice/takeProfitPrice atomically at open (side-aware corridor: long needs liq < SL < mark < TP; short inverted) — protecting every position is good practice. Quote first and CONFIRM with the user. Paper trading only (virtual mUSD). Fills follow paper_execution_v1 with a disclosed execution cost; see executionModel in quote/trade results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Futures direction: long benefits if price rises; short benefits if price falls. | |
| coinId | Yes | Coin UCID to open futures for. Use resolve_symbol first. | |
| leverage | Yes | Leverage multiplier (1-20x). | |
| agentTrace | No | Optional private trace metadata stored in the caller's ledger. | |
| marginMusd | Yes | Isolated margin in mUSD (>= 10). | |
| stopLossPrice | No | Optional resting stop-loss set atomically at open (USD trigger; fired by the per-minute worker). | |
| idempotencyKey | Yes | Unique per intent; reuse replays the original result. | |
| takeProfitPrice | No | Optional resting take-profit set atomically at open (USD trigger; fired by the per-minute worker). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| body | No | ||
| httpStatus | Yes | ||
| ledgerStatus | No | ||
| ledgerEventId | No |