Roll Contracts

View as Markdown
### Resolve the next or previous contract for multiple contracts in one request. **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 Batch version of `rollContract`. Supply a `rollContracts` array, each entry naming a contract (`name`) with a `forward` direction (`true` for the next maturity, `false` for the previous) and an optional `ifExpired` flag. Each entry is resolved independently to the adjacent contract in its product's maturity sequence. This resolves contract definitions only — it does not move positions or place orders. On success, the response `contracts` field is a map keyed by the requested contract `name`, with each value the resolved `Contract` (its `id`, `name`, and `contractMaturityId`). If the request fails, `errorText` describes the reason. **Common Failure Scenarios** - A supplied `name` does not match any contract. - There is no adjacent maturity in the requested direction for one of the entries. **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.
rollContractslist of objectsRequired

Response

RollContractsResponse
contractsobject
errorTextstring<=8192 characters

Non-empty if the request failed