Roll Contract

View as Markdown
### Resolve the next or previous contract in a product's maturity sequence. **Available to:** All authenticated users **Environments:** Demo, Live **[Rate Limit](/api/authentication#request-rate-limits-and-time-penalties):** 1,000 requests per hour, 1-second back-off, counts all requests Given a contract `name`, return the adjacent contract in the same product's maturity sequence. Set `forward` to `true` to roll to the next (later) maturity or `false` to roll to the previous (earlier) maturity. This resolves the rolled contract definition only — it does not move positions or place orders. The optional `ifExpired` flag controls when the roll is applied: when `true`, the adjacent contract is returned only if the named contract has expired; when omitted or `false`, the adjacent contract is returned unconditionally. On success, the response `contract` field contains the resolved `Contract` (its `id`, `name`, and `contractMaturityId`). If the request fails, `contract` is absent and `errorText` describes the reason. To roll several contracts in a single call, use `rollContracts`. **Common Failure Scenarios** - No contract matches the supplied `name`. - There is no adjacent maturity in the requested direction (for example, rolling forward past the last listed maturity). **Error Messages** | `errorText` | Trigger | |-------------|---------| | Non-empty `errorText` | The request failed; the field describes the reason. |

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
namestringRequired<=64 characters
forwardbooleanRequired
ifExpiredbooleanOptional

Response

RollContractResponse
errorTextstring<=8192 characters

Non-empty if the request failed

contractobject