> ## 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.

# v2 positioning

> <Warning>Preview, not deployed. The v2 gateway is built but not deployed yet; this call works once the owner deploys `silo-api`.</Warning>

Who is short, lending or flowing in? Short interest, lending trades and brokers, investor flow.

Example: `/v2/positioning?id=PETR4`

Kinds:

- `short_interest`: api.short_interest (a GET view), newest first. With no id, every ticker, paged with order + limit + offset.
- `short_by_sector`: api.short_interest_by_sector (a GET view), newest first.
- `lending`: api.lending_trades (a GET view): count, quantity, rates and how many brokers stood on each leg, newest first.
- `lending_brokers`: api.lending_participants (a GET view): per broker, quantity lent, borrowed and net, and how much it crossed its own clients, newest first.
- `investor_flow`: api.investor_flow (a GET view): buy, sell and net by investor type, newest first.

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

B3 keeps about 21 business days of the lending book and publishes no archive: history starts when SILO began capturing, and a missed session is lost, not late.

Short interest reads only B3's own Total rows of the open-position book (is_total), never the per-market rows added up. Read pct_float with float_basis: index_free_float and shares_outstanding are different denominators.

lending_brokers: the broker is the B3 participant on the leg (doador / tomador), not the beneficial owner; about 75% of trades carry the same broker on both legs. Never read a large borrow as the broker being short.

investor_flow is in R$ thousands, differenced from B3's month-to-date snapshots; a row with flow_basis unknown_opening_snapshot carries null flows on purpose.

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



## OpenAPI

````yaml /api-docs/v2/openapi.json get /positioning
openapi: 3.1.0
info:
  title: SILO API v2 (preview, not deployed)
  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. Preview, not deployed. The v2 gateway is built but not
    deployed yet; this call works once the owner deploys `silo-api`.
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/functions/v1/silo-api/v2
    description: The silo-api Edge Function (preview, not deployed).
security:
  - apikey: []
  - apikey: []
    bearerAuth: []
paths:
  /positioning:
    get:
      summary: v2 positioning
      description: >-
        <Warning>Preview, not deployed. The v2 gateway is built but not deployed
        yet; this call works once the owner deploys `silo-api`.</Warning>


        Who is short, lending or flowing in? Short interest, lending trades and
        brokers, investor flow.


        Example: `/v2/positioning?id=PETR4`


        Kinds:


        - `short_interest`: api.short_interest (a GET view), newest first. With
        no id, every ticker, paged with order + limit + offset.

        - `short_by_sector`: api.short_interest_by_sector (a GET view), newest
        first.

        - `lending`: api.lending_trades (a GET view): count, quantity, rates and
        how many brokers stood on each leg, newest first.

        - `lending_brokers`: api.lending_participants (a GET view): per broker,
        quantity lent, borrowed and net, and how much it crossed its own
        clients, newest first.

        - `investor_flow`: api.investor_flow (a GET view): buy, sell and net by
        investor type, newest first.


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


        B3 keeps about 21 business days of the lending book and publishes no
        archive: history starts when SILO began capturing, and a missed session
        is lost, not late.


        Short interest reads only B3's own Total rows of the open-position book
        (is_total), never the per-market rows added up. Read pct_float with
        float_basis: index_free_float and shares_outstanding are different
        denominators.


        lending_brokers: the broker is the B3 participant on the leg (doador /
        tomador), not the beneficial owner; about 75% of trades carry the same
        broker on both legs. Never read a large borrow as the broker being
        short.


        investor_flow is in R$ thousands, differenced from B3's month-to-date
        snapshots; a row with flow_basis unknown_opening_snapshot carries null
        flows on purpose.


        `GET /v2/positioning?help` describes the main parameters, `?help=all`
        adds the hidden ones.
      operationId: v2_positioning
      parameters:
        - name: kind
          in: query
          required: false
          description: >-
            short_interest: the short balance per ticker and session, with % of
            float and days to cover. short_by_sector: the short balance by B3
            sector. lending: daily lending trades per ticker. lending_brokers:
            per ticker, session and broker, quantity lent and borrowed.
            investor_flow: daily net flow by investor type. Default:
            short_interest.
          schema:
            type: string
            enum:
              - short_interest
              - short_by_sector
              - lending
              - lending_brokers
              - investor_flow
            default: short_interest
        - name: id
          in: query
          required: false
          description: >-
            By kind: short_interest takes a B3 ticker (none: every ticker);
            lending, lending_brokers take a B3 ticker. Kinds short_by_sector,
            investor_flow take no id. Default: none.
          schema:
            type: string
          example: PETR4
        - 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: sector
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind short_interest and
            short_by_sector: one B3 sector, exactly as B3 publishes it (Não
            classificado holds the tickers with none). Default: all.
          schema:
            type: string
            default: all
        - name: investor_type
          in: query
          required: false
          description: >-
            Hidden parameter (`?help=all` lists it). kind investor_flow: one
            investor type, exactly as B3 publishes it. Default: all.
          schema:
            type: string
            default: all
      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 api.* endpoint that answered.
          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
            - message
            - target
            - innererror
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unknown_parameter
                - unknown_id
                - unauthorized
                - forbidden_for_tier
                - over_limit
                - rate_limited
                - timeout
                - unavailable
                - internal
            message:
              type: string
            target:
              type:
                - string
                - 'null'
            innererror:
              type: object
              properties:
                sqlstate:
                  type:
                    - string
                    - 'null'
                hint:
                  type:
                    - string
                    - 'null'
                details:
                  type:
                    - string
                    - 'null'
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        The public publishable key. It identifies the project, not you, and is
        the anonymous tier.
      x-default: sb_publishable__yfFQsykAglrvc9GS6_PYw_B24ex437
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Optional. A user JWT from Supabase Auth, for the signed-in tier. Never a
        secret key.

````

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