Skip to content

Generated file. Source: docs/COI_interest_flow_diagram.md Edit the source document and run npm run docs:sync to refresh this published copy.

COI Interest Flow Diagrams

This file contains visual diagrams explaining the COI (4-year annual payout with inflation indexing) bond strategy algorithm.

Architecture Overview

COI supports two calculation paths: reinvest (shared annual-payout family) and oko (Excel-aligned helper).

flowchart LR
    A[calculateCoiBondResult] --> B{interestPayoutMode}
    B -->|reinvest| C[simulateAnnualPayoutBond]
    B -->|oko| D[simulateExcelLikeOkoBond]
    C --> E[Yearly snapshots]
    C --> F[Purchase events]
    C --> G[Payout events]
    C --> H[Yearly results]
    D --> F
    D --> H

Annual Payout Flow (Reinvest Mode)

COI pays annual interest without capitalization, allowing reinvestment of net proceeds.

flowchart TD
    A[Start year] --> B[Calculate annual interest for active positions]
    B --> C[Tax interest at 19%]
    C --> D{interestPayoutMode}
    D -->|reinvest| E[Add net interest to cash]
    D -->|oko| F[Transfer to OKO balance]
    E --> G{Redeem matured positions?}
    F --> G
    G -- Yes --> H[Add principal to cash]
    G -- No --> I[Continue]
    H --> I
    I --> J{cash >= 100 and not final year?}
    J -- Yes --> K[Buy new COI bonds]
    J -- No --> L[Skip purchase]
    K --> M{final year?}
    L --> M
    M -- Yes --> N[Early redeem remaining positions]
    M -- No --> O[Build year snapshot]
    N --> O

Rate Structure Timeline

xychart-beta
    title "COI 4-Year Rate Structure"
    x-axis ["Year 1", "Year 2", "Year 3", "Year 4"]
    y-axis "Annual Rate (%)" 4 --> 8
    bar [4.75, "inflation+1.5", "inflation+1.5", "inflation+1.5"]

OKO Balance Flow (Excel Mode)

In OKO mode, COI tracks separate balances for reinvestment cash and OKO accumulation.

stateDiagram-v2
    [*] --> InterestAccrued
    InterestAccrued --> Taxed : 19% tax applied
    Taxed --> OKOBalance : Transfer to OKO
    OKOBalance --> BondPurchase : Buy full bonds from OKO
    OKOBalance --> CarryForward : Remainder stays in OKO
    BondPurchase --> [*]
    CarryForward --> [*]

References

  • COI_logic.md - Full engine specification
  • annual_payout_logic.md - Shared payout family /home/niwciu/EMBEDDED/15_WEB_PAGES/Bondprofitabilitycalculator/docs/COI_interest_flow_diagram.md