← Back to home PT
Metodologia aberta

Foreign portfolio investment in Brazilian equities

Foreign portfolio investment in Brazilian equities

How much foreign capital entered and left Brazilian stocks each month, in US$ millions, since January 1995. That is 378 months.

Before the number: what it is NOT

This is not the "foreign flow on B3" you see in the news.

That number is the non-resident buy/sell balance on the exchange floor, published daily by B3. This one measures capital crossing the border into equities, from the central bank's balance-of-payments records.

The two correlate and tell similar stories, but they are not the same number. A foreigner already holding reais can buy stock without a single new dollar arriving; a fund can bring dollars in and take weeks to allocate. Swapping one for the other is a reading error, not a rounding one.

Why we do not publish B3's version: it has no stable machine-readable public source. On 2026-08-15 we tested six routes — the official page is a JavaScript application that returns no data in the HTML, B3's file API does not expose this report, and the alternative domains answer 403 or 404. Scraping with a headless browser would work and would break without warning at every layout change — the opposite of what this database sets out to be. We would rather publish a figure that holds and say plainly which one it is.

Why it lives in a separate section

Every indicator in this database traces back to a CVM account and is recomputable — that is what the lineage page proves, number by number.

This one is not. It is a macroeconomic aggregate the central bank compiles from foreign-exchange records: nobody rebuilds it from a public filing. You accept the BCB's figure or you do not use it.

That does not make it less true — it makes it a different kind of thing. Mixing it with the fundamentals would weaken the promise behind everything else, so it lives in its own table, its own page, and behind this notice.

Source and series

The central bank's time-series system (SGS), public JSON API, no key required. The three codes were identified by name in the official open-data catalogue (dadosabertos.bcb.gov.br), never by trial and error:

code series
22928 Portfolio investment · equities · liabilities · monthly · inflow
22929 Portfolio investment · equities · liabilities · monthly · outflow
22927 Portfolio investment · equities · liabilities · monthly · net

"Liabilities" is the correct side: from the country's point of view, incoming capital is an external liability. It is the flow from outside in — the one that matters here.

We store all three series on purpose

The net is what you read. Inflow and outflow are what let you check: the BCB publishes all three independently, and the identity

net = inflow − outflow

must hold every month. It is the only cross-check available for a figure that cannot be rebuilt from source — and it passes across all 378 months, with zero discrepancies. Storing only the net would mean storing a number with no way to verify it.

Any month missing one of the three series is discarded: without all three there is no cross-check.

Invariants

id what it blocks
I-X01 net = inflow − outflow, every month
I-X02 inflow and outflow are gross flows: never negative (only the net can be)
I-X03 the series skips no month between first and last
I-X04 period always in YYYY-MM format

I-X02 exists because a sign error in parsing would slip through unnoticed: the net would still look plausible while the gross figures were inverted. I-X03 repeats an expensive lesson — on a flow chart, a missing month becomes a flat line the reader takes for "nothing happened", which is precisely the defect that pulled the sector index offline on 2026-08-15, in another block of this database.

How to read it

The page shows both readings together, deliberately:

  • The monthly bar shows what happened that month. It is volatile: outflow months appear in the middle of inflow years and vice versa. A single bar is not a thesis.
  • The 12-month line shows the regime, which moves slowly and is usually what matters.

Reading only the bars means mistaking noise for a turning point.

One thing the data shows and headlines hide: the gross flow is enormous and stable — inflows typically run between US$ 12 and 19 billion a month. What flips sign is the balance, the difference between two large, similar numbers. That is why the net swings so much: small percentage moves in the gross become large relative moves in the balance.

It is denominated in dollars, which also means exchange-rate variation affects comparisons across distant periods.

It is a descriptive map — "this is what happened" — not a decision rule. Money that came in is not a buy signal.