Skip to content

igcp-aforro

Deterministic, decimal-safe Aforro Série E and Série F simulator. Drop-in for JS/TS apps; ships with a CLI and a static `rates.json` for everyone else.

igcp-aforro reproduces the IGCP Aforro Série E and Série F calculation end-to-end:

  • Resolves the monthly base rate from the antepenultimate-business-day Euribor 3M average. Série F clamps the rounded mean to [0%, 2.5%]; Série E adds a +1pp spread (E3 + 1%) and clamps to [0%, 3.5%].
  • Adds the permanence-premium tier that applies to the cohort’s contract year (per-series tier table).
  • Compounds quarterly with 28% IRS withholding at each capitalization.
  • Returns decimal strings so callers can JSON-serialize results without precision loss.
  • JS/TS app? Install the npm package and call simulate().
  • Shell user? Install the CLI and run aforro simulate.
  • Python / Java / Excel user? Fetch the precomputed rates.json and write a ~50-line compounder.

The library covers Série E (subscriptions open from 1 Nov 2017 to 1 Jun 2023, 10-year maturity) and Série F (subscriptions open from 1 Jun 2023 onwards, 15-year maturity) end-to-end. Older series (A, B, C, D) are out of scope — the Series abstraction in src/core/series.ts leaves room to add them as additional constants tables without restructuring.