"""Reperform one fictional bond through HTM, AFS, and trading reporting lanes. Run with: uv run python linden-peak-debt-security-lanes.py No third-party packages are required. """ from __future__ import annotations def money(amount: float) -> str: """Format a signed dollar amount with commas and parentheses.""" return f"(${abs(amount):,.2f})" if amount < 0 else f"${amount:,.2f}" def present_value_of_bond(face: float, coupon: float, periodic_yield: float, periods: int) -> float: coupon_value = coupon * (1 - (1 + periodic_yield) ** -periods) / periodic_yield principal_value = face * (1 + periodic_yield) ** -periods return coupon_value + principal_value face_amount = 500_000.0 stated_annual_rate = 0.05 effective_annual_rate = 0.06 payments_per_year = 2 remaining_periods = 6 cash_interest = face_amount * stated_annual_rate / payments_per_year periodic_yield = effective_annual_rate / payments_per_year opening_amortized_cost = present_value_of_bond( face_amount, cash_interest, periodic_yield, remaining_periods ) interest_revenue = opening_amortized_cost * periodic_yield discount_amortization = interest_revenue - cash_interest ending_amortized_cost = opening_amortized_cost + discount_amortization print("LINDEN PEAK — ONE BOND, THREE SUPPLIED CLASSIFICATIONS") print("All entities, judgments, and amounts are fictional.\n") print("1. Shared contractual and effective-interest row") print(f" Coupon cash: {money(face_amount)} × 5.00% ÷ 2 = {money(cash_interest)}") print(f" Opening amortized cost: {money(opening_amortized_cost)}") print(f" Interest revenue: {money(opening_amortized_cost)} × 3.00% = {money(interest_revenue)}") print( f" Discount amortization: {money(interest_revenue)} − {money(cash_interest)} " f"= {money(discount_amortization)}" ) print(f" Ending amortized cost: {money(ending_amortized_cost)}\n") held_to_maturity_allowance = 4_500.0 held_to_maturity_reported = ending_amortized_cost - held_to_maturity_allowance print("2. Supplied held-to-maturity lane") print(f" Gross amortized cost: {money(ending_amortized_cost)}") print(f" Less supplied credit allowance: {money(-held_to_maturity_allowance)}") print(f" Net reported asset: {money(held_to_maturity_reported)}\n") available_for_sale_fair_value = 470_000.0 available_for_sale_credit = 3_000.0 total_decline = available_for_sale_fair_value - ending_amortized_cost noncredit_oci = total_decline + available_for_sale_credit print("3. Supplied available-for-sale lane") print(f" Ending amortized cost: {money(ending_amortized_cost)}") print(f" Supplied credit loss in earnings: {money(-available_for_sale_credit)}") print(f" Noncredit fair-value loss in OCI: {money(noncredit_oci)}") print(f" Reported fair-value asset: {money(available_for_sale_fair_value)}") afs_check = ( ending_amortized_cost - available_for_sale_credit + noncredit_oci - available_for_sale_fair_value ) print(f" Bridge difference: {money(afs_check)}\n") trading_fair_value = 490_000.0 trading_gain = trading_fair_value - ending_amortized_cost print("4. Supplied trading lane") print(f" Ending amortized cost: {money(ending_amortized_cost)}") print(f" Fair-value gain in earnings: {money(trading_gain)}") print(f" Reported fair-value asset: {money(trading_fair_value)}\n") print("BOUNDARY") print("This script does not establish classification, intent and ability, credit loss,") print("fair value, valuation technique, tax, entries, or disclosure compliance.")