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

> What a fund owns, and which funds own a ticker — the one edge joining the fund universe to the quote tape.

CVM's portfolio composition filing (CDA) publishes, per fund and month, the
**B3 ticker** of each equity position and the **CNPJ** of each held fund. That
makes two questions answerable that nothing else in this warehouse can answer:

* *What does this fund actually own?*
* *Which funds own this ticker, and how did that change?*

<Note>
  This is the only join between funds and the quote tape, and it is CVM's own
  published identifier — never a name match.
</Note>

## POST /rpc/fund\_holdings

Give **exactly one** of `p_cnpj` or `p_ticker`. Neither would be an unbounded
scan of every fund ever filed; both is ambiguous. Either mistake is a `22023`
error naming which one you made, not a silently narrowed query.

| Argument | Type | Meaning |
| - | - | - |
| `p_cnpj` | text | The **holder**. What this fund owns. Punctuation is stripped. |
| `p_ticker` | text | The **held** equity. Which funds own it. Case-insensitive. |
| `p_from` / `p_to` | date | Competency-month window. Omit for everything held. |
| `p_kind` | text | `equity` (default, CDA block 4) or `fund` (block 2). |
| `p_limit` | int | Optional explicit head: the newest N rows (1..1000). Omit it for the whole window, which refuses with `22023` above 1,000 rows instead of trimming (until catalog v41 this clamped silently at 500 / 5,000). |

```bash theme={null}
# Which funds held PETR4, most recent months first
curl -s -X POST "$SILO/rest/v1/rpc/fund_holdings" \
  -H "apikey: $KEY" -H "Content-Type: application/json" \
  -d '{"p_ticker":"PETR4","p_from":"2024-01-01"}'
```

```python theme={null}
silo.fund_holdings(ticker="PETR4", start="2024-01-01")
silo.fund_holdings(cnpj="05754060000113")                # what it owns
silo.fund_holdings(cnpj="05754060000113", kind="fund")   # held FUNDS
```

### Response

| Column | Meaning |
| - | - |
| `cnpj` | the holding fund |
| `period` | competency month, first-of-month |
| `kind` | `equity` or `fund` |
| `held_id` | B3 ticker, or the held fund's CNPJ |
| `held_name` | as published |
| `tp_aplic` | application type — see the warning below |
| `tp_negoc` | trading intent (`Para negociação`, …) |
| `emissor_ligado` | `S` when the held asset belongs to the same economic group. **CVM's published flag, not an inference.** |
| `qt_pos_final`, `vl_merc_pos_final` | quantity and market value, as filed |

<Warning>
  **Rows are not summed.** A fund files the same ticker under several
  application types — `Ações`, `BDR nível I`, `BDR não patrocinado`, *"Ações e
  outros TVM cedidos em empréstimo"* — and those are genuinely different
  positions with different quantities. One `NFLX34` holding appears twice in a
  single month for a single fund because the fund holds two different BDR
  programmes. Sum them yourself if that is what you want; the API will not
  decide it for you.
</Warning>

## POST /rpc/fund\_debentures — the corporate-credit edge

CDA **block 6** publishes, per fund and month, each debenture position with
the **issuer's own CPF/CNPJ** — so *which funds hold this issuer's paper?* is
answerable with no bridge table and no name match.

It is a separate function, not a third `p_kind`, on purpose. A debenture has
no `CD_ATIVO`: its identity is (issuer, maturity, rate structure), and two
series of one issuer maturing the same day at different coupons are different
securities holding different money. Forcing that into `held_id` / `held_name`
would collapse them into indistinguishable rows.

Give **exactly one** of `p_cnpj` or `p_issuer`:

| Argument | Type | Meaning |
| - | - | - |
| `p_cnpj` | text | The **holder**. What this fund owns. |
| `p_issuer` | text | The **issuer**. A listed company's ticker or CVM code (resolved only through CVM's published FCA map, active listings), or **any CPF/CNPJ** — most debenture issuers are not listed, and their CNPJ is the only way to reach them. |
| `p_from` / `p_to` | date | Competency-month window. |
| `p_limit` | int | Optional explicit head: the newest N rows (1..1000). Omit it for the whole window, which refuses with `22023` above 1,000 rows instead of trimming (until catalog v41 this clamped silently at 500 / 5,000). |

```bash theme={null}
# Which funds hold Petrobras debentures — the ticker resolves through the FCA map
-d '{"p_issuer":"PETR4","p_from":"2025-01-01"}'
# An unlisted issuer, by CNPJ
-d '{"p_issuer":"02998301000181"}'
```

```python theme={null}
silo.fund_debentures(cnpj="05754060000113")     # what it holds
silo.fund_debentures(issuer="PETR4")             # who holds its paper
silo.fund_debentures(issuer="02998301000181")    # an unlisted issuer
```

One row per (fund, month, issuer, maturity, rate structure, application type),
as filed — **never summed**:

| Column | Meaning |
| - | - |
| `cnpj`, `period` | the holding fund and the competency month |
| `issuer_id`, `issuer_kind`, `issuer` | the issuer's CPF/CNPJ (digits), `PF`/`PJ`, and name, as published |
| `issuer_tickers` | the issuer's **active** listed codes from the FCA map — an array, because one issuer can have `PETR3` and `PETR4`; `null` when not listed |
| `tp_aplic`, `tp_ativo`, `tp_negoc`, `emissor_ligado` | application type, security type, trading intent, CVM's related-party flag |
| `maturity` | `DT_VENC` |
| `indexer`, `indexer_pct`, `coupon_pct` | post-fixed structure: `DI1` / `IPCA` …, % of the indexer, spread over it |
| `fixed_rate_pct` | pre-fixed rate, when the paper is pre-fixed instead |
| `titulo_cetip` | CETIP code, as published |
| `qt_pos_final`, `vl_merc_pos_final`, `vl_custo_pos_final` | quantity, market value, cost, as filed |

An unknown ticker raises `22023`; an unknown CNPJ simply has no rows — the
warehouse cannot tell an issuer it has never seen from one that has no
debentures held.

## Coverage

Holdings run from **2005**, from the yearly CDA archives before 2023 and the
monthly ones after. Blocks 1, 3, 5, 7 and 8 of the same filing are not
served — see [the data inventory](/api-docs/data-inventory) for what each
holds and why.


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