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

# fund_investors

> One FI fund's monthly investor profile (CVM PERFIL_MENSAL), oldest first: one row per stored (cnpj, period), period being the month's last day (DT_COMPTC). For each of CVM's 16 investor types (pf_pb, pf_varejo, pj_nao_financ_pb, pj_nao_financ_varejo, banco, corretora_distrib, pj_financ, invnr, eapc, efpc, rpps, segur, capitaliz, fi_clube, distrib, outro): holders_<type> is the number of quotaholders of that type (NR_COTST_*) and pl_pct_<type> their share of the fund's PL in percent as filed (PR_PL_COTST_*), never rescaled. largest_holder_pl_pct is PR_PATRIM_LIQ_MAIOR_COTST, the largest single quotaholder's share of PL in percent as filed; CVM files 0 for most funds, so a 0 is not evidence of no concentration. Nothing is derived: no type is merged, no total or retail split is computed, shares are not normalised to 100, and no investor is identified. NULL means the source left it blank, never zero. Months ingested before the typed columns existed are read from the raw source row, validated (digits only for counts, digits with one decimal separator for percentages; anything else NULL). FI funds only, from 2019-01. Not point-in-time: the newest file ingested for each month. p_cnpj is required (punctuation is stripped); p_from / p_to bound period (NULL = no bound). More than 1000 rows RAISES 22023 (never trimmed): narrow the window.

**Row cap.** A window producing more than 1000 rows raises SQLSTATE `22023` naming this function. Nothing is trimmed to fit — PostgREST would silently cut the response at 1000 and a cut-short series is indistinguishable from one that simply ends. This function does not page — narrow the window instead.



## OpenAPI

````yaml /openapi.json post /rpc/fund_investors
openapi: 3.1.0
info:
  title: SILO Data API
  version: '92'
  summary: >-
    Read-only Brazilian public financial data: CVM filings, BACEN series, B3
    quotes and the B3 BDI group.
  description: >
    Schema `api` over PostgREST. Views are `GET /<view>`; functions are

    `POST /rpc/<function>` with a JSON body.


    **This document is generated** from the live Postgres catalog by

    `scripts/gen_openapi.py` — `pg_get_function_arguments` for the RPC
    signatures,

    `information_schema.columns` for the view columns, and the granted-to-`anon`

    privilege set for which objects exist at all. It is not hand-maintained, and

    `tests/test_openapi_spec.py` fails the build when it drifts from the SQL.


    ### Two different ceilings


    Reading one for the other is the most expensive mistake on this API.


    * **The row cap refuses.** Sixty-seven set-returning functions raise
    SQLSTATE
      `22023` when the window they were handed would produce more than 1000 rows.
      Nothing is trimmed, and the error says why and how to fix it (the message,
      plus PostgREST's `details` and `hint`). Five of them (`panel`,
      `quote_history`, `fund_nav`, `index_history`, `trade_consolidated_history`)
      take a `p_after` cursor so you can walk the series; the other sixty-two ask you to narrow the window. `fund_nav` paging
      additionally REQUIRES `p_entity_type` — its cursor is a bare period, which
      is unique only within one family, and CNPJs that file under both `fi` and
      `fidc` in the same month would otherwise be ambiguous.
    * **The tier ceiling.** `search_funds` (since v81), `option_chain` and
      `option_exercises` (since v91) refuse (`22023`) when more rows match than
      their per-tier maximum. Zero other functions silently lower `p_limit` to a
      per-tier maximum: nothing is cut to fit. Signing in raises the ceiling.

    Separately from both, PostgREST's server-wide `db-max-rows = 1000` cuts
    every

    response, on every endpoint, for every tier. On the GET views
    `Content-Range`

    is the signal (`0-999/*`); `Prefer: count=exact` turns the `*` into a total.


    ### Retention


    Most of this warehouse is append-only history. The **B3 BDI group** —

    `short_interest`, `short_interest_by_sector`, `investor_flow`,

    `lending_trades`, `lending_participants` — is not: B3 keeps roughly 21
    business

    days and publishes no archive. A missed session cannot be bought back. See

    Market Coverage.
  license:
    name: See repository
    url: https://github.com/PedroDnT/SILO-BZ
servers:
  - url: https://zcjbtpxuhdekpwcxmepn.supabase.co/rest/v1
    description: Supabase PostgREST, schema `api`
security:
  - apikey: []
tags:
  - name: ANBIMA
  - name: Company events
  - name: Coverage & catalog
  - name: Derivatives
  - name: FIDC
  - name: FNET documents
  - name: Financials
  - name: Funds
  - name: Gateway
  - name: Holdings
  - name: Inflation
  - name: Lookup
  - name: Macro
  - name: Macro expectations
  - name: Other
  - name: Panel
  - name: Portfolio
  - name: Quotes
  - name: Rates
  - name: Research
  - name: Screens
  - name: Securities lending
  - name: Short interest & flows
paths:
  /rpc/fund_investors:
    post:
      tags:
        - Funds
      summary: fund_investors
      description: >-
        One FI fund's monthly investor profile (CVM PERFIL_MENSAL), oldest
        first: one row per stored (cnpj, period), period being the month's last
        day (DT_COMPTC). For each of CVM's 16 investor types (pf_pb, pf_varejo,
        pj_nao_financ_pb, pj_nao_financ_varejo, banco, corretora_distrib,
        pj_financ, invnr, eapc, efpc, rpps, segur, capitaliz, fi_clube, distrib,
        outro): holders_<type> is the number of quotaholders of that type
        (NR_COTST_*) and pl_pct_<type> their share of the fund's PL in percent
        as filed (PR_PL_COTST_*), never rescaled. largest_holder_pl_pct is
        PR_PATRIM_LIQ_MAIOR_COTST, the largest single quotaholder's share of PL
        in percent as filed; CVM files 0 for most funds, so a 0 is not evidence
        of no concentration. Nothing is derived: no type is merged, no total or
        retail split is computed, shares are not normalised to 100, and no
        investor is identified. NULL means the source left it blank, never zero.
        Months ingested before the typed columns existed are read from the raw
        source row, validated (digits only for counts, digits with one decimal
        separator for percentages; anything else NULL). FI funds only, from
        2019-01. Not point-in-time: the newest file ingested for each month.
        p_cnpj is required (punctuation is stripped); p_from / p_to bound period
        (NULL = no bound). More than 1000 rows RAISES 22023 (never trimmed):
        narrow the window.


        **Row cap.** A window producing more than 1000 rows raises SQLSTATE
        `22023` naming this function. Nothing is trimmed to fit — PostgREST
        would silently cut the response at 1000 and a cut-short series is
        indistinguishable from one that simply ends. This function does not page
        — narrow the window instead.
      operationId: rpc_fund_investors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                p_cnpj:
                  type:
                    - string
                    - 'null'
                p_from:
                  type:
                    - string
                    - 'null'
                  format: date
                  description: Defaults to `NULL::date`.
                  default: null
                p_to:
                  type:
                    - string
                    - 'null'
                  format: date
                  description: Defaults to `NULL::date`.
                  default: null
              required:
                - p_cnpj
      responses:
        '200':
          description: >-
            The result set, oldest first. An unknown id is an empty array, not a
            404 and never a guessed value.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    cnpj:
                      type:
                        - string
                        - 'null'
                    period:
                      type:
                        - string
                        - 'null'
                      format: date
                    fund_type:
                      type:
                        - string
                        - 'null'
                    holders_pf_pb:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_pf_varejo:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_pj_nao_financ_pb:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_pj_nao_financ_varejo:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_banco:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_corretora_distrib:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_pj_financ:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_invnr:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_eapc:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_efpc:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_rpps:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_segur:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_capitaliz:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_fi_clube:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_distrib:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    holders_outro:
                      type:
                        - integer
                        - 'null'
                      format: int64
                    pl_pct_pf_pb:
                      type:
                        - number
                        - 'null'
                    pl_pct_pf_varejo:
                      type:
                        - number
                        - 'null'
                    pl_pct_pj_nao_financ_pb:
                      type:
                        - number
                        - 'null'
                    pl_pct_pj_nao_financ_varejo:
                      type:
                        - number
                        - 'null'
                    pl_pct_banco:
                      type:
                        - number
                        - 'null'
                    pl_pct_corretora_distrib:
                      type:
                        - number
                        - 'null'
                    pl_pct_pj_financ:
                      type:
                        - number
                        - 'null'
                    pl_pct_invnr:
                      type:
                        - number
                        - 'null'
                    pl_pct_eapc:
                      type:
                        - number
                        - 'null'
                    pl_pct_efpc:
                      type:
                        - number
                        - 'null'
                    pl_pct_rpps:
                      type:
                        - number
                        - 'null'
                    pl_pct_segur:
                      type:
                        - number
                        - 'null'
                    pl_pct_capitaliz:
                      type:
                        - number
                        - 'null'
                    pl_pct_fi_clube:
                      type:
                        - number
                        - 'null'
                    pl_pct_distrib:
                      type:
                        - number
                        - 'null'
                    pl_pct_outro:
                      type:
                        - number
                        - 'null'
                    largest_holder_pl_pct:
                      type:
                        - number
                        - 'null'
        '400':
          description: >-
            Bad request. Contract violations raise SQLSTATE `22023` with a
            message naming the limit or the argument at fault.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            No usable `apikey`, or a request for a schema outside `api`.
            `Accept-Profile: public` and any `cvm_*` / `b3_cotahist` / `cia_*`
            path answer 401 for every caller, by grant — schema `api` is the
            entire public surface.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such endpoint in schema `api`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      description: >-
        PostgREST error body. `code` carries the SQLSTATE — `22023` is a
        contract refusal.
      properties:
        code:
          type:
            - string
            - 'null'
          examples:
            - '22023'
        message:
          type:
            - string
            - 'null'
        details:
          type:
            - string
            - 'null'
        hint:
          type:
            - string
            - 'null'
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        The publishable key (`sb_publishable_…`), on every request. It is NOT a
        JWT — sending it as `Authorization: Bearer` is rejected as an invalid
        JWT. It identifies the project, not you, and maps to the Postgres `anon`
        role.

````

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