Open futures position
open_futures_positionOpen or add to a mock futures position in paper trading. Specify coin, side, leverage, margin, and optional stop-loss/take-profit for atomic order placement.
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 funds (50,000 mUSD). Not financial advice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coinId | Yes | Coin UCID to open futures for. Use resolve_symbol first. | |
| side | Yes | Futures direction: long benefits if price rises; short benefits if price falls. | |
| leverage | Yes | Leverage multiplier (1-20x). | |
| marginMusd | Yes | Isolated margin in mUSD (>= 10). | |
| idempotencyKey | Yes | Unique per intent; reuse replays the original result. | |
| stopLossPrice | No | Optional resting stop-loss set atomically at open (USD trigger; fired by the per-minute worker). | |
| takeProfitPrice | No | Optional resting take-profit set atomically at open (USD trigger; fired by the per-minute worker). | |
| agentTrace | No | Optional private trace metadata stored in the caller's ledger. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| httpStatus | Yes | HTTP status returned by CoinRithm, or 0 for network errors. | |
| ok | Yes | True when CoinRithm returned a successful 2xx response. | |
| ledgerEventId | No | Private AgentActionEvent id returned by /api/agent/*, when present. | |
| ledgerStatus | No | Ledger write status header returned by CoinRithm, when present. | |
| body | No | Parsed CoinRithm response body, or raw text when the response is not JSON. |