Interest.fs: variable/stepped rate schedules and interest-only periods#55
Draft
Copilot wants to merge 4 commits into
Draft
Interest.fs: variable/stepped rate schedules and interest-only periods#55Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/daaab3da-b9f1-46ca-bdb9-3fb9cafa12be Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
…utoGenerateSchedule Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/daaab3da-b9f1-46ca-bdb9-3fb9cafa12be Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
…ule in effectiveRate Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/daaab3da-b9f1-46ca-bdb9-3fb9cafa12be Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extend Interest.fs for variable rate schedules and interest-only periods
Interest.fs: variable/stepped rate schedules and interest-only periods
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two common product structures — tracker/stepped-rate schedules and interest-only phases — were not modelable in the library. This PR adds both as first-class, composable features.
Variable/Stepped Rate Schedules
Interest.BasicConfiggains aRateSchedule: RateSchedulefield ((Date * Rate) array). Each entry overridesStandardRatefrom its effective date forward; promotional rates still take priority. Empty array = existing behaviour.RateSchedule.effectiveRatepicks the most recent entry witheffectiveDate ≤ currentDate, sorting defensively against unsorted input.Interest-Only Periods
AutoGenerateSchedulegains aRepaymentTypefield:CapitalAndInterest: existing bisection-based level payment, unchanged.InterestOnly: each scheduled payment = capped interest accrued; the final payment additionally clears the outstanding principal.Mixed n: firstnpayment items are interest-only; the remaining items are generated via the standard bisection solver starting from the full (unreduced) principal balance.Both features compose naturally — a tracker mortgage with a 2-year interest-only period:
Backward Compatibility
All existing record constructions require the two new fields. Defaults for existing code:
RateSchedule = [||]andRepaymentType = RepaymentType.CapitalAndInterest.