> ## Documentation Index
> Fetch the complete documentation index at: https://octo-98895abd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Derivatives

> Options, termo and futures: chains, histories, exercises, the DI1 settlement.

Example: `/v2/derivatives?id=PETRL&kind=chain`

Kinds:

- `chain`: api.option_chain: calls and puts of one prefix on one session, by expiry, strike, side. One call holds the chain, served in pages; a chain above the SQL tier ceiling (200 anonymous, 1,000 signed in) is refused: narrow with a longer id (one expiry month, e.g. PETRL), date or expiry_from.
- `history`: api.option_history: one option code's daily quotes, oldest first. Refuses above 1000 rows: narrow from/to.
- `exercises`: api.option_exercises: exercise prints for a prefix, oldest first. Paged by date windows; a window above the SQL tier ceiling (500 anonymous, 1,000 signed in) is halved.
- `termo`: api.termo_history: one termo code's daily quotes, oldest first. Refuses above 1000 rows: narrow from/to.
- `futures`: api.future_series: one DI1, DOL or WDO contract through time, oldest first. Refuses above 1000 rows.
- `futures_nth`: api.future_nth_series: the Nth nearest contract of a root (id: DI1, DOL or WDO) through time, oldest first. Each row is that contract's published row with its ticker, so the roll shows in the ticker column; nothing is adjusted or spliced, and the price jumps at each roll. Refuses above 1000 rows.
- `futures_curve`: api.future_curve: every contract of a root (id, default DI1) on one session, nearest first.
- `di_settlement`: api.di_settlement (a GET view): DI1 settlement rate, previous rate, open interest per session and contract, newest first. With no id, every contract, paged with order + limit + offset.

With no `from`, a dated kind reads the last 12 months to `to`.

id per kind: chain and exercises take an option prefix (at least 3 characters, e.g. PETR); history and termo one B3 code (codneg); futures one outright contract (DI1F27, DOLF27); futures_nth a root (DI1, DOL or WDO), with rank; futures_curve a root (DI1, DOL or WDO; none: DI1); di_settlement one DI1 contract (none: every contract).

chain and exercises refuse above a tier ceiling (chain 200 anonymous, exercises 500, both 1,000 signed in); nothing is cut. chain refuses (over_limit, tier_cap); exercises halves its date window and tries again, and refuses only a single day that is still over the ceiling.

Exercises are exercise events, not quotes. DI1 rates are % a.a. on 252 business days, as B3 settles them; nothing is derived.

`GET /v2/derivatives?help` describes the main parameters, `?help=all` adds the hidden ones.



## OpenAPI

````yaml /api-docs/v2/openapi.json get /derivatives
openapi: 3.1.0
info:
  title: SILO API v2
  version: v2
  description: >-
    The v2 gateway over SILO's schema `api`: 14 resources, five shared
    parameters, one envelope and one error object. Generated from
    supabase/functions/silo-api/registry.ts by scripts/gen_openapi_v2.py; do not
    edit by hand. The original v1 API stays available until it is retired.
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/functions/v1/silo-api/v2
    description: The silo-api Edge Function.
security:
  - {}
  - bearerAuth: []
tags:
  - name: Discovery
  - name: Markets and macro
  - name: Companies and funds
  - name: Research
paths:
  /derivatives:
    get:
      tags:
        - Markets and macro
      summary: Derivatives
      description: >-
        Options, termo and futures: chains, histories, exercises, the DI1
        settlement.


        Example: `/v2/derivatives?id=PETRL&kind=chain`


        Kinds:


        - `chain`: api.option_chain: calls and puts of one prefix on one
        session, by expiry, strike, side. One call holds the chain, served in
        pages; a chain above the SQL tier ceiling (200 anonymous, 1,000 signed
        in) is refused: narrow with a longer id (one expiry month, e.g. PETRL),
        date or expiry_from.

        - `history`: api.option_history: one option code's daily quotes, oldest
        first. Refuses above 1000 rows: narrow from/to.

        - `exercises`: api.option_exercises: exercise prints for a prefix,
        oldest first. Paged by date windows; a window above the SQL tier ceiling
        (500 anonymous, 1,000 signed in) is halved.

        - `termo`: api.termo_history: one termo code's daily quotes, oldest
        first. Refuses above 1000 rows: narrow from/to.

        - `futures`: api.future_series: one DI1, DOL or WDO contract through
        time, oldest first. Refuses above 1000 rows.

        - `futures_nth`: api.future_nth_series: the Nth nearest contract of a
        root (id: DI1, DOL or WDO) through time, oldest first. Each row is that
        contract's published row with its ticker, so the roll shows in the
        ticker column; nothing is adjusted or spliced, and the price jumps at
        each roll. Refuses above 1000 rows.

        - `futures_curve`: api.future_curve: every contract of a root (id,
        default DI1) on one session, nearest first.

        - `di_settlement`: api.di_settlement (a GET view): DI1 settlement rate,
        previous rate, open interest per session and contract, newest first.
        With no id, every contract, paged with order + limit + offset.


        With no `from`, a dated kind reads the last 12 months to `to`.


        id per kind: chain and exercises take an option prefix (at least 3
        characters, e.g. PETR); history and termo one B3 code (codneg); futures
        one outright contract (DI1F27, DOLF27); futures_nth a root (DI1, DOL or
        WDO), with rank; futures_curve a root (DI1, DOL or WDO; none: DI1);
        di_settlement one DI1 contract (none: every contract).


        chain and exercises refuse above a tier ceiling (chain 200 anonymous,
        exercises 500, both 1,000 signed in); nothing is cut. chain refuses
        (over_limit, tier_cap); exercises halves its date window and tries
        again, and refuses only a single day that is still over the ceiling.


        Exercises are exercise events, not quotes. DI1 rates are % a.a. on 252
        business days, as B3 settles them; nothing is derived.


        `GET /v2/derivatives?help` describes the main parameters, `?help=all`
        adds the hidden ones.
      operationId: v2_derivatives
      parameters:
        - name: kind
          in: query
          required: false
          description: >-
            chain: one session's option chain for a prefix. history: one
            option's daily quotes. exercises: option exercise events for a
            prefix. termo: one forward (termo) code's quotes. futures: one
            futures contract's daily settlement. futures_nth: the Nth nearest
            contract of a root through time (rank 2 = the 2nd contract), each
            row with its ticker, nothing adjusted. futures_curve: every contract
            of a root on one session. di_settlement: DI1 settlement rates per
            session and contract. Default: chain.
          schema:
            type: string
            enum:
              - chain
              - history
              - exercises
              - termo
              - futures
              - futures_nth
              - futures_curve
              - di_settlement
            default: chain
          example: chain
        - name: date
          in: query
          required: false
          description: >-
            kind chain and futures_curve: the B3 session, YYYY-MM-DD. A date
            with no session returns no rows. Default: the latest session held
            (chain: the newest option session; futures_curve: the root's newest
            session).
          schema:
            type: string
            format: date
        - name: id
          in: query
          required: false
          description: >-
            By kind: chain, exercises take an option prefix, at least 3
            characters (PETR); history takes one option code (codneg); termo
            takes one termo code (codneg); futures takes one outright futures
            contract (DI1F27, DOLF27); futures_nth takes a futures root, DI1,
            DOL or WDO (with rank: 2 = the 2nd contract); futures_curve takes a
            futures root, DI1, DOL or WDO (none: DI1); di_settlement takes one
            DI1 contract (none: every contract). Required for kinds chain,
            history, exercises, termo, futures, futures_nth. Default: none.
          schema:
            type: string
          example: PETRL
        - name: from
          in: query
          required: false
          description: >-
            First date of the window, YYYY-MM-DD. Default: the resource's
            default window, counted back from to.
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: false
          description: >-
            Last date of the window, YYYY-MM-DD. Default: the latest complete
            period, from coverage.
          schema:
            type: string
            format: date
        - name: limit
          in: query
          required: false
          description: >-
            The page size. More rows than one page come through next_page_url,
            never cut silently; a call stops at the tier's rows-per-call cap
            with meta.tier_cap_reached. Default: the tier's page maximum (10
            anonymous, 100 signed in); a larger value is coerced to it.
          schema:
            type: integer
            minimum: 1
        - name: cursor
          in: query
          required: false
          description: >-
            The opaque cursor from a previous next_page_url. It carries every
            other parameter: send it alone (another parameter with a different
            value is bad_request). Default: none: the first page.
          schema:
            type: string
        - name: expiry_from
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind chain: only series
            expiring on or after this date. Default: today (the SQL's
            CURRENT_DATE): expired series are left out.
          schema:
            type: string
            format: date
        - name: rank
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind futures_nth: which
            contract, by maturity, on each session. 1 = the nearest contract
            alive (the contract of the session's own month is left out, as it
            matures on that month's first business day), 2 = the next, and so
            on. Default: the SQL default, 1 (the nearest contract alive).
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: The v2 envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
        default:
          description: >-
            The v2 error object. A SILO refusal (over_limit) keeps its message,
            hint and details verbatim.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Envelope:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items: {}
          description: Always a list. Rows as the endpoint returned them; null stays null.
        meta:
          type: object
          required:
            - resource
            - kind
            - request
            - id_known
          properties:
            resource:
              type: string
            kind:
              type:
                - string
                - 'null'
            request:
              type: object
              description: Every parameter the resource takes, with the default applied.
            id_known:
              type:
                - boolean
                - 'null'
              description: Whether SILO holds the id; null when the call names none.
            endpoint:
              type: string
              description: The data endpoint that answered.
            source:
              type: string
              description: >-
                The canonical request to cite: /v2/<resource>? with every
                applied parameter, defaults included, so it replays the same
                rows. POST says so; its lists are in meta.body.
            data_through:
              type:
                - string
                - 'null'
              format: date
              description: >-
                The newest elapsed period SILO holds for the dataset this
                endpoint reads (the coverage resource's data_through for
                coverage_dataset). Null when no coverage row applies or the
                coverage read failed; never a guess.
            coverage_dataset:
              type:
                - string
                - 'null'
              description: >-
                The coverage dataset data_through comes from; null when none
                applies.
            data_through_error:
              type: string
              description: >-
                Present only when the coverage read failed: why data_through is
                null. The rows are unaffected.
            tier:
              type: string
              enum:
                - anonymous
                - signed_in
                - pro
            tier_cap_reached:
              type: boolean
              description: True when the result is partial because of the tier cap.
          additionalProperties: true
        next_page_url:
          type: string
          description: Present only when more rows remain. It carries one opaque cursor.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - reason
            - message
            - target
            - innererror
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unknown_parameter
                - unknown_id
                - unauthorized
                - payment_required
                - forbidden_for_tier
                - over_limit
                - rate_limited
                - timeout
                - unavailable
                - internal
            reason:
              type:
                - string
                - 'null'
              enum:
                - row_cap
                - tier_cap
                - null
              description: >-
                over_limit only: row_cap (over one 1,000-row page: narrow or
                page) or tier_cap (over the tier ceiling: narrow or sign in).
                Null otherwise.
            message:
              type: string
            target:
              type:
                - string
                - 'null'
            innererror:
              type: object
              properties:
                sqlstate:
                  type:
                    - string
                    - 'null'
                hint:
                  type:
                    - string
                    - 'null'
                details:
                  type:
                    - string
                    - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: SILO user access token for authenticated data requests.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.