Skip to content

fix(financial): support dynamic discount rates in sensitivity analysi… - #613

Open
esegbueadam-sys wants to merge 4 commits into
Heliobond:mainfrom
esegbueadam-sys:fix/discount-rate-sensitivity
Open

fix(financial): support dynamic discount rates in sensitivity analysi…#613
esegbueadam-sys wants to merge 4 commits into
Heliobond:mainfrom
esegbueadam-sys:fix/discount-rate-sensitivity

Conversation

@esegbueadam-sys

Copy link
Copy Markdown
Contributor

fix(financial): resolve hardcoded discount-rate in sensitivity analysis (#522)

Description:

Refactored sensitivity analysis in src/lib/financial.ts to support dynamic discount rates.

Updated SensitivityVariation to support additive percentage-point deltas (kind: "delta").

Updated performSensitivityAnalysis to apply deltas relative to the provided discount_rate base input rather than assuming a fixed 7%.

Added regression tests in src/tests/financial.test.ts verifying accuracy for non-default discount rates (e.g., 10%).

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing checklist

  • Tests pass locally
  • Added new tests (if applicable)
  • Code follows project conventions

Closes #522

@drips-wave

drips-wave Bot commented Sep 2, 2026

Copy link
Copy Markdown

@esegbueadam-sys Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@esegbueadam-sys

Copy link
Copy Markdown
Contributor Author

Done

@esegbueadam-sys
esegbueadam-sys force-pushed the fix/discount-rate-sensitivity branch from 19e3c3e to 3298af4 Compare September 2, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discount-rate sensitivity analysis hardcodes a 0.07 base rate — wrong results for any project not at exactly 7%

1 participant