Central Bank SGS, Focus and PTAX, plus the calendar
Business day, 252 basis, actual over forecast, contract reference date
Daily curves, monthly series, FX and accumulated factors
Interest and debt engines, currency conversion and AI agent
What it solves
- Rates come from the official source every day, with no manual file that stops being updated.
- The accumulated rate between two dates is always calculated the same way, with business days and holidays.
- Forecast and actual live in the same series, flagged, and the actual replaces the forecast when it is published.
Business questions it answers
Ask your agent these questions once the case is live.
What you need
- REST sources for the Central Bank's SGS, Focus and PTAX set up in Nekt
- A calendar table with national holidays and a business-day flag
- For each contract or product: index, percentage or spread, day-count convention and reference date
What you get
- Daily curves per business day with daily rate, annual rate, status and source
- Monthly inflation and expectations series, with actual and forecast
- Closing FX per day, ready to join
- An AI agent that answers about rates with the right convention
Where to activate
Dividend, interest and amortization engines read the consolidated curve by each contract's reference date.
Answers accumulated rates, forecasts and FX stating the convention, the source and whether the value is actual or forecast.
A notice when a business day goes without an index or FX publication beyond the normal delay.
Public sources and fixed rules. The care is in each contract's day-count convention and reference date. The detailed view has the business rules, the pitfalls and the acceptance test. Or send everything straight to your agent with the Nekt MCP.
The CDI rate comes per day, the Focus Selic comes per year and by reference year, IPCA comes as the month's change and PTAX has several bulletins a day. Whoever adds daily rates, mixes a 252 basis with 365 or takes the FX rate from the wrong hour ends up with interest that does not match the statement. And when the source is a manually downloaded file, it stops being updated on some random day and the calculations keep running on the last value.
How it is usually done, and the rule
Each row is a mistake that already happened in practice.
Read the series straight from the Central Bank's SGS and Olinda, loaded daily. An FX file kept in a folder stopped being fed and the calculations ran on the last value for months. Long series may come partitioned by period (by decade, for example); unify them in one table without duplicating the boundary.
Daily curves have one row per business day, from the calendar table with fixed and movable national holidays (Carnival, Good Friday and Corpus Christi computed from Easter). A business day with no publication inside the actual period repeats the last published value, flagged as filled. Weekends and holidays have no row.
Daily CDI and Selic from SGS come as a percentage per day. Annual rate = (1 + daily rate)^252 - 1; daily rate = (1 + annual rate)^(1/252) - 1. Whenever an annual rate is adjusted (for example, with a spread), recalculate the daily rate after the adjustment, never before.
The factor between two dates is the product of (1 + daily rate) on each business day in the interval, start date included and end date excluded, or the contract's convention. A percentage of CDI applies the percentage to the daily rate before the product; CDI plus spread compounds the annual spread converted to daily. Monthly inflation accumulates as the product of (1 + the month's change).
Floating rates on CDI and Selic use business days over 252. Some systems calculate fixed-rate instruments in calendar days over 365. The same bond gives different values under the two conventions. Store the convention with the product and use the same one in every report.
The consolidated series combines actual and forecast with status and source on every row. The Selic forecast comes from the latest Focus median per reference year, turned into a monthly path in steps of 0.50 or 0.25 percentage points in Copom (monetary policy committee) meeting months; after the last Focus year, the last level is held constant. Forecast CDI = forecast Selic minus 0.10 percentage points a year. When the actual comes out, it replaces the forecast for that date.
Each contract states which index value to use: the previous month's Selic, the observation on the 20th (or the closest one) for a monthly cycle, the IPCA for the accrual month or the 12-month accumulated value. Inflation adjustment and interest may use different indexes on the same item, each with its own accrual period. Store the rule in the contract and join on the reference date, not on the calculation date.
A floating rate is index plus spread or a percentage of the index, and some contracts have a ceiling: apply the lower of the calculated rate and the cap. Do not confuse CDI plus spread with a percentage of CDI. In brokerage reports, the field that tells the two apart is often correct only for CDI and repeats the index for the others.
From PTAX, use the selling rate of the closing bulletin, the last of the day. Deduplicate by day before any join, so rows are not multiplied. Convert each amount at the rate for the date of the fact and keep the original amount, currency, rate and rate date. When the source already carries the rate it used (dollar commissions at the closing rate), use that one.
Series and where to find them
Central Bank of Brazil, with the series code and the unit it arrives in.
Definitions
Pitfalls that already happened
The rate came from a file in a shared folder that stopped being updated. The average dollar price kept being calculated at a stale rate until someone noticed.
Switch to the official API and alert on business days without a rate.
The FX table had more than one rate per day, and joining it to the orders duplicated positions.
One rate per day before the join.
A fixed-income view calculated redemption value only for fixed-rate bonds and left floating-rate ones empty, because Selic was not in the base.
Join floating-rate bonds to the index's daily curve.
A query validated in the editor failed when it became a transformation, because the execution engine was different and handled date and array functions another way.
Validate on the same engine the transformation will run on.
Debt contracts mature up to ten years out, beyond the last year covered by the Focus survey. Without a rule for that stretch, the interest engine has no rate at the end of the contract.
Build the curve to the latest maturity, holding the last Focus level constant.
Acceptance test
The case is done when every item passes.
- The daily curve has exactly one row per calendar business day in the period, and none on weekends or holidays.
- The CDI accumulated over a closed month from the daily curve matches the SGS 4391 series for the same month (difference below 0.01 percentage point).
- For every date with a published actual, the consolidated series carries the actual status.
- The FX table has at most one rate per day, and every business day in the last 30 days has a rate or an alert.
- Running the load again does not change any actual value already stored.
Agent package
Paste into Claude, ChatGPT or any client with the Nekt MCP connected.
Official benchmark rates - Source: Central Bank of Brazil API. Daily CDI SGS 12, monthly CDI SGS 4391, daily Selic SGS 11, monthly Selic SGS 4390, IPCA SGS 433, IGP-M SGS 189, Focus in Olinda Expectations, PTAX in Olinda. - Daily curves: one row per business day from the calendar table. A business day with no publication repeats the last value, flagged. - Annual rate = (1 + daily rate)^252 - 1. Daily rate = (1 + annual rate)^(1/252) - 1. - Accumulated between dates = product of (1 + daily rate) over the business days. Never add rates or take an average. - Percentage of CDI: apply the percentage to the daily rate. CDI plus spread: compound the spread converted to daily. Cap: the lower of the calculated rate and the ceiling. - Day-count convention per product: <BD/252 for floating rate; CD/365 for <product>>. - Consolidated series: actual takes priority; forecast comes from Focus in steps in Copom months. Forecast CDI = forecast Selic - 0.10 p.p. - Reference date: the contract's (e.g. previous month's Selic, observation on the 20th). Never the calculation date. - FX: selling PTAX from the last bulletin of the day, one rate per day, by the date of the fact. Keep original amount, rate and rate date. - Always say whether the number is actual or forecast and the date of the latest publication. Client exceptions: - <client>: product <product> uses <index> from the <day> of the previous month, capped at <x>% a year. - <client>: dollar commissions already arrive with the broker's closing rate; do not convert again.
Build the "Official benchmark rates" case in my Nekt workspace following the rules at https://academy.nekt.com/en/industrias/financeiros/indexadores-oficiais.md. 1) Find the source tables and confirm the columns the rules use. 2) Create a transformation at the stated grain applying every rule. 3) Run the acceptance test and show me the result of each item. 4) Create the case's context document in the workspace, leaving my clients' exceptions open for me to fill in.
Variations
Items adjusted by an inflation index up to a date and with Selic interest afterwards, each part with its own accrual period and accumulated value.
International market revenue converted at the closing rate for the date, with the dollar amount preserved.
Rent, tuition or installments adjusted by 12-month accumulated IPCA or IGP-M on the contract anniversary.