Skip to content

feat(lending): JIT interest accrual, multi-collateral support, and#711

Open
Spycall wants to merge 1 commit into
MettaChain:mainfrom
Spycall:fix/lending-jit-accrual-multi-collateral-and-storage-derives
Open

feat(lending): JIT interest accrual, multi-collateral support, and#711
Spycall wants to merge 1 commit into
MettaChain:mainfrom
Spycall:fix/lending-jit-accrual-multi-collateral-and-storage-derives

Conversation

@Spycall

@Spycall Spycall commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

storage-derive tests

Closes #587
Closes #588
Closes #589

Also fixed missing LoanApplication fields (loan_type, start_block) that were referenced in liquidate_loan but absent from the struct, and removed a duplicate #[path = "test.rs"] module include that caused a compile error.

…orage-derive tests

Closes MettaChain#587, MettaChain#588, MettaChain#589

- MettaChain#587: Confirm interest accrual uses JIT snapshots updated only on
  position-modifying calls (approve_loan_restructuring, liquidate_loan,
  update_servicing_status). Regression test added under
  contracts/lending/src/test.rs.

- MettaChain#588: Allow a single borrower position to be backed by N collateral
  assets with weighted health-factor calculation. Added
  pledge_additional_collateral, should_liquidate_loan, and updated
  liquidate_loan to accept Vec<(u64, u128)> current collateral values.
  LTV is computed against total debt (principal + accrued interest) and
  the liquidation threshold is an assessed-value-weighted average across
  all pledged collaterals.

- MettaChain#589: Added storage_derivation_tests asserting all pub-storage types
  derive Encode, Decode, TypeInfo, and StorageLayout.

Also fixed missing LoanApplication fields (loan_type, start_block) that
were referenced in liquidate_loan but absent from the struct, and removed
a duplicate #[path = "test.rs"] module include that caused a compile
error.
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Spycall 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant