moonbit-fixedincome

    Fixed-income cash-flow generation and pricing primitives in MoonBit.

    fixed-income
    bond
    cash-flow
    finance
    pricing
    Download zip
    Author
    Version
    0.2.1
    License
    Apache-2.0
    Last updated
    2 months ago
    Downloads
    33

    No dependencies

    #MoonBit 固定收益现金流定价库

    moonbit-fixedincome is an original MoonBit library for deterministic fixed-income cash-flow generation and pricing. It is designed for bonds, notes, and loans that need auditable schedules, discounting, and risk metrics without a market-data service.

    #Scope

    • Gregorian dates, holidays, business-day adjustment, and five day-count conventions.
    • Fixed coupon cash flows, accrued interest, zero-coupon notes, and maturity principal.
    • Equal-principal and equal-payment loan schedules with explicit prepayment events.
    • Flat and piecewise discount curves, present value, simple-yield solving, clean/dirty price, duration, convexity, and flat-curve stress tests.
    • Floating-rate note projection, callable exercise metadata, probability-weighted cash-flow trees, parallel curve sensitivity, and portfolio aggregation.
    • Cash-flow books, ledgers, forecasts, waterfalls, quote batches, curve calibration, projections, risk snapshots, validation reports, and portfolio exposure analytics.
    • Cross-platform CI for wasm, wasm-gc, JavaScript, and native targets, with a manual MoonCakes publishing workflow.

    The library intentionally does not connect to live prices, provide investment advice, or claim production trading-system compliance.

    #Quick start

    Run the deterministic example:

    moon run cmd/fixedincome

    The public API keeps cash-flow generation separate from discounting, so an application can replace DiscountCurve without changing bond or loan definitions.

    #Development

    moon check --deny-warn moon test --deny-warn moon fmt --check moon info moon run cmd/fixedincome moon run cmd/benchmark

    The repository uses the strict flags supported by the current stable CLI and checks generated interfaces after moon info.

    #Provenance and license

    The implementation is original MoonBit code. Formula notes and market-convention references are listed in docs/formula-notes.md. No third-party implementation source is copied into this repository. The project is released under Apache-2.0; see LICENSE.