Skip to content

create_fvtpl_bond

Generate fvtpl_bond.zip -- a single FVTPL Corporate Bond.

Simulation start date: 2022-01-04.

Instrument              Basis            Amount     Acquired     Side   Book
────────────────────    ───────────────  ─────────  ──────────   ─────  ───────
Common Equity           NA               1,000,000  2021-01-04   SHORT  BANKING
Customer Deposit (0%)   NA               6,000,000  2021-06-01   SHORT  BANKING
5Y Corp Bond 4% FVTPL   FVTPL             (NPV)    2021-03-15   LONG   TRADING

Bond: issued 2020-06-01, 5Y, 4% semi-annual coupon, matures 2025-06-01. Deposit carries 0% interest. Bond acquisition cost is QuantLib NPV at acquisition date. The bond is classified as Fair Value Through Profit or Loss (FVTPL) in the trading book — mark-to-market gains and losses flow directly through the income statement.

Run::

uv run python src/brms/data/create_fvtpl_bond.py <data_folder>

Where contains treasury_yields.csv.

Functions:

  • create_fvtpl_zip

    Write the FVTPL bond simulation zip to out_path and return its path.

create_fvtpl_zip

create_fvtpl_zip(
    data_folder: Path, out_path: Path | None = None
) -> Path

Write the FVTPL bond simulation zip to out_path and return its path.

data_folder must contain treasury_yields.csv.