Close futures position
close_futures_positionClose or partially reduce a simulated futures position. Use fraction (0,1] for partial close, or omit for full close. IdempotencyKey required for safe replay.
Instructions
Close or partially reduce a mock futures position. fraction in (0,1] reduces partially; omit (or 1) for a full close. idempotencyKey is REQUIRED. Requires the trade:futures scope. Paper trading only — virtual funds (50,000 mUSD). Not financial advice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positionId | Yes | Open futures position id to close or reduce. | |
| fraction | No | (0,1] portion to close; omit/1 = full close. | |
| idempotencyKey | Yes | Unique per close intent; reuse replays the original result. | |
| 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. |