Skip to content

Conversation

@liobrasil
Copy link
Contributor

feat(FlowCreditMarket): implement FixedRateInterestCurve and KinkInterestCurve for variable interest rates based on utilization to enhance lending flexibility

feat(FlowCreditMarket): add support for zero-rate interest curves for testing scenarios where no interest accrues
fix(FlowCreditMarket): update event names and parameters for better clarity and consistency in the contract
test(interest_curve): add comprehensive tests for FixedRateInterestCurve and KinkInterestCurve to ensure correct interest rate calculations and edge cases
chore(tests): refactor tests to use new zero-rate curve functions and update references to ensure consistency across test cases

Closes: #???

Description


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

…restCurve for variable interest rates based on utilization to enhance lending flexibility

feat(FlowCreditMarket): add support for zero-rate interest curves for testing scenarios where no interest accrues
fix(FlowCreditMarket): update event names and parameters for better clarity and consistency in the contract
test(interest_curve): add comprehensive tests for FixedRateInterestCurve and KinkInterestCurve to ensure correct interest rate calculations and edge cases
chore(tests): refactor tests to use new zero-rate curve functions and update references to ensure consistency across test cases
@liobrasil liobrasil requested a review from a team as a code owner December 9, 2025 00:56
@liobrasil liobrasil changed the title [WIP] Implement interest curve Implement interest curve Dec 10, 2025
@liobrasil liobrasil marked this pull request as draft December 10, 2025 01:25
…mprehensive tests

- Fix Pool.setInterestCurve() to compound interest at OLD rate before switching curves
- Add FixedRateInterestCurve for stable assets (spread model)
- Add KinkInterestCurve for volatile assets (Aave v3-style reserve factor model)
- Add interest_accrual_integration_test.cdc (6 tests)
- Add interest_curve_advanced_test.cdc (4 tests for edge cases)
- Add borrow_from_position.cdc transaction helper
- Add get_block_timestamp.cdc script helper

All 34 interest curve tests passing
@liobrasil liobrasil marked this pull request as ready for review December 16, 2025 17:27
@liobrasil liobrasil requested a review from Gornutz December 17, 2025 22:44
liobrasil and others added 2 commits December 18, 2025 19:11
- Add contextual values to precondition error messages in
  FixedRateInterestCurve and KinkInterestCurve for easier debugging
- Remove external protocol references (Morpho, Aave) from comments
- Add comprehensive documentation to integration tests explaining
  the spread model, interest calculation formulas, and test scenarios
- Reorganize test scripts from test_scripts/ to scripts/ directory
- Update FlowActions submodule

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@liobrasil liobrasil force-pushed the lionel/interest-curve branch from b7e2535 to 8c6dab9 Compare December 19, 2025 05:42
@liobrasil liobrasil merged commit 7d54a1f into main Dec 19, 2025
1 check passed
@liobrasil liobrasil deleted the lionel/interest-curve branch December 19, 2025 06:26
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.

5 participants