Contents Lesson 16 of 16

7 min read · professional

Macro, rates and credit — course checkpoint

You started this course able to read a headline about inflation and the 10-year. You finish able to say which endpoint each of those came from, what units it was in, when it was published, and what it does not contain.

Unit 1 — the economy as a time series

/macro-indicator/{country} takes an ISO-3 country and one of 39 indicator codes, defaulting to gdp_current_usd. Six fields per row, and Date is the end of the period described, not the publication date. US annual CPI inflation reads 2.9495 for 2024 and 8.0028 for 2022; German GDP growth runs one year further, to 2025.

There is no vintage, no publication date and no revision flag in that payload. Backtesting on it hands your model the future — the survivorship-and-biases trap in its most practical form. The check you can run: previous on release N+1 should equal actual on release N. For US year-on-year inflation from February to June 2026 the chain holds at 2.4, 3.3, 3.8, 4.2, 3.5.

/economic-events uses ISO-2 codes, defaults to limit=50 (the US week of 13 to 17 July 2026 held 115 events when re-counted on 28 September 2026, so the default is a truncation), and returns a bare array with no total. estimate is often null, one release can appear under two type labels, and change comes back null rather than 0 when nothing changed. And change_percentage on a rate series is nonsense: the June 2026 month-on-month inflation row reads −180.

Unit 2 — the risk-free curve

Four endpoints, one envelope of meta / data / links, all in long format: one row per (date, tenor), which you pivot. The tenor set is not fixed — 14 tenors in 2026 including 1.5M, but only nine in 1990, with no 20Y at all. And on this family only filter[year] works: from, to and page[limit] are accepted and ignored, so a one-day request hands you the whole year and the narrowing is yours to do.

On 27 July 2026 the curve ran 1M 3.80 up to 20Y 5.15, with the 30Y at 5.12 — inverted at the very long end. 10Y minus 2Y was 34 bps, against 42 on 1 June.

/ust/bill-rates gives seven tenors and two rates per bill. The 13-week on 27 July: discount 3.82, coupon 3.91 — reproduce it as 100 × (1 − 0.0382 × 91/360) = 99.0344, then (0.9656 ÷ 99.0344) × 365/91 = 3.911%. Add the 3M CMT of 3.96 and you have three correct three-month rates 14 basis points apart.

/ust/real-yield-rates gives only five tenors; the 10-year breakeven on 27 July was 221 bps. /ust/long-term-rates gives three rate_type values and a cross-check worth asserting: BC_20year 5.15 equals the 20Y CMT.

Unit 3 — policy and funding

Administered versus measured is the distinction the whole unit rests on. /rates/policy-rates returns two Fed codes (3.50 and 3.75, midpoint 3.625 derived), three ECB codes (DFR 2.25, MRO 2.40, MLF 2.65) and one BoE code (3.75). It stores a step function daily, so the 27,182 ECB rows of 2026-07-28 are repetition, not decisions.

/rates/reference-rates returned ten codes for 27 July 2026 on the day this course was written, and eleven when re-checked a month later, across three rate_type values. SOFR 3.64 on $2,953 billion, EFFR 3.63 on $104 billion — about 28 times the volume behind the secured benchmark. ESTR 2.185 printed 6.5 bps below the ECB deposit rate; SONIA 3.7307 printed 1.93 bps below Bank Rate. Rows from non-US publishers carry no percentiles and no volume_billion_usd keys at all.

/spreads/funding-stress does not page, and ships the formula string with every number. SOFR_TARGET_LOWER read 14 bps on 27 July 2026 — and 325 bps on 17 September 2019, against 43 the day before.

Five unit conventions coexist across this course: percent (4.65), basis points (14), decimal fractions (0.0044), index levels (0.13 and 1.25249067), and millions of dollars (2,429,758).

Unit 4 — pricing credit

Three questions, three publishers, three frequencies. /credit-risk/sovereign/credit-ratings gives the opinion: USA Aa1 / AA+ / AA+, annual, one row, a categorical string with no arithmetic. /credit-risk/sovereign/cds-spreads gives the price: 0.0044 = 44 bps, nullable wherever no liquid market exists. /credit-risk/cds-market/aggregates gives the size, weekly at T+17, with TOTAL sitting inside the region column ready to double your sums.

/credit-risk/sovereign/default-spreads maps 20 rating buckets to fractions, Aaa at exactly 0 — returned in string order, so Aaa lands seventh. For Brazil, /credit-risk/sovereign/risk-premium gives CRP 324.1 bps and ERP 7.471%, and 7.471 − 3.241 = 4.23% recovers the mature-market base.

/credit-risk/corporate/hqm-yields is monthly: 10Y par 5.18 and spot 5.27 on 1 June 2026. Against the same-date Treasury 10Y of 4.47 the spread is 71 bps; against the newest Treasury of 4.65 it is 53, an 18-basis-point error from one date mismatch. /credit-risk/corporate/cmdi is weekly and was five weeks stale on 28 July.

The four sentences worth keeping

  1. A macro value has two dates — the period it describes and the day it became public — and most APIs give you only the first. Everything about revisions and look-ahead bias follows from that one omission.
  2. Every rate needs three labels: units, convention, and who produced it. Percent or basis points or a fraction; discount or coupon-equivalent; par or spot; administered or measured. A number without those three is not yet data.
  3. A spread is a subtraction, and the two operands must share a date and a tenor. Eighteen basis points of the HQM example came from nothing but a two-month date mismatch.
  4. A rating is an opinion on a schedule; a CDS spread is a price; an index is neither. They answer different questions about the same country, and the skill is holding all three without collapsing them into one.

Before you sit it

Each of these is a minute at your desk. Any one that is not names the lesson to reopen first.

Try it now

  1. Build one table for 27 July 2026 with the Treasury curve, the reference rates, the policy rates and the funding-stress spreads side by side, every column named with its unit. Here are the four inputs, each fetched for that date. Every join in your table is a date join, and every one can go wrong.
Live API response: mda22 ust curve 2026 07 27
Live API response: mda2 sofr effr 2026 07 27
Live API response: mda22 policy rates 2026 07 27
Live API response: mda22 funding stress 2026 07 27
  1. Compute the corporate-over-Treasury 10-year spread twice, inner-joined on date and latest-of-each. The corporate leg is the HQM 10-year par yield, then the Treasury 10Y on 1 June 2026 and on its newest date (data[-3]). Keep the difference as a permanent reminder.
Live API response: mda2 hqm 10y par since june
Live API response: mda2 ust 10y on 2026 06 01
Live API response: mda2 ust latest curve
  1. Write down, for each of the sixteen endpoints in this course, its response shape, frequency and publication lag. No payload contains that table; you assemble it from the lessons you have read, from their meta blocks and from the as_of_date next to each value.

Nothing here recommends a security, a country, a rate view or a strategy. It describes how these datasets are shaped, what their fields mean, and where they will mislead you if read carelessly. Next in this domain: derivatives, FX, commodities and crypto, where joining gets harder because the instruments themselves expire.